[prev] 48 [next]

Insertion at Root (cont)

Method for inserting at root:
  • base case:
    • tree is empty; make new node and make it root
  • recursive case:
    • insert new node as root of appropriate subtree
    • lift new node to root by rotation