This theory is part of Premium
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricingInsert like a BST, then repair the first unbalanced node on the way back with one or two rotations.
What this asks
Insert while keeping every subtree within a height difference of one.
Insert like a BST, then walk home updating heights and repair the first unbalanced node with one or two rotations.
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricing