예제 #1
0
 public TreeSort(Stack p,WriteOutput w)
 {
     tree = new Tree(p);
     writer = w;
     inOrder(tree.root);
     writer.write("The tree sort took " + tree.c +  " comparisons");
 }
예제 #2
0
        public ReadInput(String i)
        {
            input = File.ReadAllLines(i);
            output = new Stack();

            foreach (String x in input)
            {
                try
                {
                    Int32.Parse(x);
                    output.push(Int32.Parse(x));
                }
                catch (Exception e)
                {
                }
            }
        }
예제 #3
0
 public Tree(Stack x)
 {
     items = x;
     root = new Node(getNextItem());
     fillTree();
 }