コード例 #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));
 }