dsa

Data Structures & Algorithms - Spring 2018
Log | Files | Refs | README

BSTPInterface.java (963B)


      1 package lab11;
      2 
      3 public interface BSTPInterface <T extends KeyedItem<KT>,KT extends Comparable<? super KT>>  {
      4 
      5     public int getHeight();
      6 // returns the height of the tree (recursive implementation)
      7 
      8     public int getSize();
      9 // returns the number of nodes in the tree(recursive implementation)
     10 
     11     public String toStringInorder();
     12 // returns String representation of Tree with items in Inorder
     13 //(recursive implementation)
     14 
     15     public String toStringPreorder();
     16 // returns String representation of Tree with items in Preorder
     17 //(recursive implementation)
     18 
     19     public String toStringPostorder();
     20 // returns String representation of Tree with items in Postorder
     21 // (recursive implementation)
     22 
     23     public MyBinarySearchTreePlus<T,KT> getCopyOfTree();
     24 // returns a new tree containing a copy of the original tree
     25 // with the same structure. Note: the new tree should not have
     26 // any shared nodes with the original.(recursive implementation)
     27 
     28 }// end BSTPInterface