private void traverse(Node<T, V> subTree) { if (subTree == null) { return; } else { System.out.print(subTree.t + " "); traverse(subTree.leftChild); traverse(subTree.rightChild); } }
@Override public String toString() { // TODO Auto-generated method stub // preroot to show the structure of this tree traverse(tree); return "-- Pre-root traverse of the current tree."; }