public Tree_Serialization() { testcases.Add(new InOut <char>(Helfer.AssembleBTreeCharPreOrder("abcf//ksz//kql//kqk/elstw/gh/legpwgw/"), c => c + "", s => s[0])); testcases.Add(new InOut <int>(Helfer.AssembleBTreePreOrder("/"), i => i + "", int.Parse)); testcases.Add(new InOut <char>(Helfer.AssembleBTreeCharPreOrder("a,b,c,/,/,/,f,g,/"), c => c + "", s => s[0])); testcases.Add(new InOut <int>(Helfer.AssembleBTreePreOrder("5,6,8,/,/,/,5,4,/"), i => i + "", int.Parse)); }
public InOut(string s, string s2) : base(Helfer.AssembleBTreePreOrder(s), Helfer.AssembleBTreePreOrder(s2), true) { copiedInputProvider = arg => arg.CopyIt(); HasMaxDur = false; AddSolver(LevelTree); AddSolver(Bullshit_Solution); }
public InOut(string tree, string arr) : base(Helfer.AssembleBTreePreOrder(tree, new IntBinaryTree()) as IntBinaryTree, Helfer.Assemble(arr), true) { ergStringConverter = arg => Helfer.Arrayausgabe <int>("Ausgabe: ", arg); outputStringConverter = arg => Helfer.Arrayausgabe <int>("Erwartet: ", arg); CompareOutErg = Helfer.ArrayVergleich; AddSolver((arg, erg) => erg.Setze(arg.LargestPathSumfromRootToLeafRecursive()), "Recursive"); }
public Input(string preorder, string preorder2) { tree = Helfer.AssembleBTreePreOrder(preorder); sub = Helfer.AssembleBTreePreOrder(preorder2); }
public InOut(string s, int i) : base(Helfer.AssembleBTreePreOrder(s), i, true) { AddSolver((arg, erg) => erg.Setze(Minimum_level_sum(arg))); }
public InOut(string s, int k, string s2) : base(new Input(s, k), Helfer.AssembleBTreePreOrder(s2), true) { AddSolver((arg, erg) => erg.Setze(arg.Tree.RemoveLeavesK_Recursive(arg.k)), "Recursive"); AddSolver((arg, erg) => erg.Setze(arg.Tree.RemoveLeavesK_Iterative(arg.k)), "Iterative"); }
public Input(string s, int k) { this.k = k; this.tree = Helfer.AssembleBTreePreOrder(s); }
public Input(string tree, int node) { this.tree = Helfer.AssembleBTreePreOrder(tree); this.node = this.tree.GetNodeByValue(node); }
public InOut(string tree, int level) : base(Helfer.AssembleBTreePreOrder(tree), level, true) { AddSolver((arg, erg) => erg.Setze(arg.GetMinimumDepthIt()), "Iterativ"); AddSolver((arg, erg) => erg.Setze(arg.GetMinimumDepthRecursive()), "Rekursiv"); HasMaxDur = false; }
public InOut(string tree, int outp) : base(Helfer.AssembleBTreePreOrder(tree), outp, true) { AddSolver((arg, erg) => erg.Setze(arg.GetRoot().SumRootToLeafRecursive(i => i)), "SumRootToLeaf"); }
public Full_Binary_Tree() { testcases.Add(new InOut <int>(Helfer.AssembleBTreePreOrder("1,2,0,/,/,/,3,9,/,/,4"), Helfer.AssembleBTreePreOrder("1,0,/,/,3,9,/,/,4"))); }
public InOut(string preOrder, int i) : base(Helfer.AssembleBTreePreOrder(preOrder), i, true) { AddSolver((arg, erg) => erg.Setze(arg.GetLevelOfTreeSum(), Complexity.LINEAR, Complexity.LINEAR)); }