private static IntSearchTree BuildBSTFromList(IntSearchTree treeInt, List <int> list) { if (list.Count == 0) { return(null); } List <int> auxList = new List <int>(); for (int index = 0; index < list.Count; index++) { if (auxList.Contains(list[index])) { continue; } auxList.Add(list[index]); treeInt.Add(list[index]); } return(treeInt); }
public static string ToStringPreOrder(IntSearchTree treeInt) { return(ToStringPreOrder(treeInt.root)); }
public static int Sum(IntSearchTree treeInt) { return(Sum(treeInt.root)); }
public static bool ExistsST(IntSearchTree treeInt, int value) { return(ExistsST(treeInt.root, value)); }
public static int Height(IntSearchTree treeInt) { return(Height(treeInt.root)); }