示例#1
0
文件: Program.cs 项目: myu404/IntBST
        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);
        }
示例#2
0
文件: Program.cs 项目: myu404/IntBST
 public static string ToStringPreOrder(IntSearchTree treeInt)
 {
     return(ToStringPreOrder(treeInt.root));
 }
示例#3
0
文件: Program.cs 项目: myu404/IntBST
 public static int Sum(IntSearchTree treeInt)
 {
     return(Sum(treeInt.root));
 }
示例#4
0
文件: Program.cs 项目: myu404/IntBST
 public static bool ExistsST(IntSearchTree treeInt, int value)
 {
     return(ExistsST(treeInt.root, value));
 }
示例#5
0
文件: Program.cs 项目: myu404/IntBST
 public static int Height(IntSearchTree treeInt)
 {
     return(Height(treeInt.root));
 }