Exemplo n.º 1
0
 public void Insert(Tree tree)
 {
     if(tree._key < _key)
         Left = tree;
     else
         Right = tree;
 }
Exemplo n.º 2
0
        public ArrayList Sort(ArrayList inArray)
        {
            if (inArray.Count < 1)
                return inArray;

            var tree = new Tree((int)inArray[0]);
            for (int i = 1; i < inArray.Count; i++ )
                tree.Insert(new Tree((int)inArray[i]));

            return tree.ToArrayList();
        }