Subversion Repositories programming

Rev

Blame | Last modification | View Log | RSS feed

// Written by Ira Snyder
// Due Date: 11-15-2004
// Project #3

import java.io.*;
import java.util.*;
class BinaryTree {
    private Object root;
    private BinaryTree left, right;

    //constructors ----------------------------------------------------------
    public BinaryTree( Object root ) { }
    public BinaryTree( Object root, BinaryTree left, BinaryTree right ) { }
    public BinaryTree( BinaryTree that ) { }

    //getter methods --------------------------------------------------------
    public Object getRoot() { }
    public BinaryTree getLeft() { }
    public BinaryTree getRight() { }

    //setter methods --------------------------------------------------------
    public Object setRoot( Object Root ) { }
    public BinaryTree setLeft( BinaryTree left ) { }
    public BinaryTree setRight( BinaryTree right ) { }

    //toString method -------------------------------------------------------
    public String toString() { }

    //misc methods ----------------------------------------------------------
    public boolean isLeaf() { }
    public int size() { }
    public int height() { }
    public boolean contains( Object object ) { }
    public int numLeaves() { }
    public int count( Object x ) { }
    public boolean isFull() { }
    public boolean isBalanced() { }
    public int pathLength() { }
    public BinaryTree reverse() { }
    public int level( Object x ) { }
    public boolean isDisjointFrom( BinaryTree that ) { }
    public boolean isValid() { }
    public boolean equals( Object object ) { }

    //printing methods ------------------------------------------------------
    public static void preOrderPrint( BinaryTree tree ) { }
    public static void postOrderPrint( BinaryTree tree ) { }
    public static void levelOrderPrint( BinaryTree tree ) { }
    public static void inOrderPrint( BinaryTree tree ) { }
}

/*
      BufferedReader kb = new BufferedReader(
                              new InputStreamReader(System.in));


      BufferedReader br = new BufferedReader(
                              new InputStreamReader(
                                  new FileInputStream(filename)));

      PrintStream ps = new PrintStream(
                           new FileOutputStream(
                               new File(filename)));

*/