public class BST { // this Binary Search Tree is used for the implementation of the // symbol tables containing Symbols: (key,value) pairs // A Symbol is a Comparable object containing a String Identifier key // and an Integer value private BSTNode root; //empty tree public BST(){ this.root = null; } public boolean isEmpty(){ return root==null; } public void insertItem(Symbol item) throws BSTException{ root = insertItem(root, item); } private BSTNode insertItem(BSTNode node, Symbol item) throws BSTException{ return null; } public Symbol retrieveItem(String key){ return retrieveItem(root,key); } private Symbol retrieveItem(BSTNode node, String key){ return null; } public void preorderTraverse(){ if (!isEmpty()) preorderTraverse(root,""); else System.out.println("root is null"); } public void preorderTraverse(BSTNode node, String indent){ System.out.println(indent+node.getItem()); if(node.getLeft()!=null) { System.out.println(indent+"left"); preorderTraverse(node.getLeft(),indent+" "); } if(node.getRight()!=null) { System.out.println(indent+"right"); preorderTraverse(node.getRight(),indent+" "); } } }