Binary Search Tree implementation java : Insertion, Deletion, Right Rotate, Left Rotate, Predecessor, Successor, Inorder

A binary search tree is a data structure having the following properties

  • It has only one root node.
  • Each node can have at most two children.
  • The value of left child is always smaller than its parent.
  • The value of right child is always greater than its parent.
  • Every node has the following attributes :- parent, leftChild, rightChild and key.
Inorder Traversal: It is a kind of traversal in which first the nodes of every subtree are processed in the following order : left child, root and right child. In this way the nodes of a tree are processed in an ascending order.