[prev] 64 [next]

Red-Black Tree Insertion

Insertion is more complex than for standard BSTs
  • need to recall direction of last branch (left or right)
  • splitting/promoting implemented by rotateLeft/rotateRight
  • several cases to consider depending on colour/direction combinations