previous | start | next

Implementing a Binary Search Tree

public class BinarySearchTree
{
   public BinarySearchTree() { . . . }
   public void add(Comparable obj) { . . . }
   . . .
   private Node root;
   private class Node
   {
      public void addNode(Node newNode) { . . . }
      . . .
      public Comparable data;
      public Node left;
      public Node right;
   }
}

previous | start | next