public InOut(string s, char c) : base(Helfer.AssembleBTreeChar(s, new BinaryCompleteTree <char>()), c, true)
 {
     inputStringConverter = arg => "Binary Tree: " + arg.PrintIterative(TraverseType.LevelOrder);
     AddSolver((arg, erg) => erg.Setze(arg.GetDeepestNodeIt().Val), "Iterativ");
     AddSolver((arg, erg) => erg.Setze(arg.GetDeepestNodeRecursive().Val), "Recursive");
 }
Example #2
0
 public InOut(string input, string output) : base(Helfer.AssembleBTreeChar(input) as BinarySearchTree <char>, Helfer.AssembleBTreeChar(output) as BinarySearchTree <char>, true)
 {
     copiedInputProvider = arg => Helfer.AssembleBTreeChar(input) as BinarySearchTree <char>;
     AddSolver((inp, erg) => erg.Setze(inp.InvertRecursive() as BinarySearchTree <char>), "InvertiereRekursiv");
 }
 public Count_Number_of_Unival_Subtrees()
 {
     testcases.Add(new InOut <int>(Helfer.AssembleBTree("0102210222211", new BinaryCompleteTree <int>(), true), 5));
     testcases.Add(new InOut <char>(Helfer.AssembleBTreeChar("aaa//aa///////A", new BinaryCompleteTree <char>()), 3));
     testcases.Add(new InOut <char>(Helfer.AssembleBTreeChar("acb//bb///////b", new BinaryCompleteTree <char>()), 5));
 }
Example #4
0
 public Input(string s, int height)
 {
     this.height = height;
     Helfer.AssembleBTreeChar(s, tree);
 }