@@ -0,0 +1,619 @@
+public Node getSuccessor(Node n)%7B%0A   Node pointer = n;%0A   %0A      %0A   %0A      if(pointer.right!=null)%7B%0A         pointer = pointer.right;%0A         while(pointer.left!=null)%7B%0A            pointer = pointer.left;%0A         %7D%0A         return pointer;%0A      %7D%0A   %0A      Node ancestor = pointer.parent;%0A      Node child = pointer;%0A      while (ancestor !=null && ancestor.right==pointer) %7B%0A         /*if(pointer.parent==null)%0A            return null;%0A         return pointer.parent;*/%0A         return ancestor;%0A      %7D%0A   %0A   %0A   %0A  /* right -%3Etraverse left subtree%0A   no right -%3E return parent%0A   right leaf -%3E root%0A   */%0A   %0A%7D%0A

Create bstSuccessor.java