DS – AVL Tree Operations

Insertions:

Insert 20: Every node insert with red color

  • Uncle node(70) is red, hence re-painting is required
  • Parent(30) to black
  • Uncle(70) to black
  • Grandparent(50) to red

Root node(50) must be black

Insert 50, 20, and 10:

Insert 50, 20, and 40:

Insert:  50, 70, and 60

Insert 70, 40, 20, and 30:

Insert 50, 80 and 10:

Insert 90:

Insert 85:

Insert 95:

Scroll to Top