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 pricingThe next larger key: the leftmost node of the right subtree, or the first ancestor that turns right.
What this asks
Find the next larger key after a given node.
The leftmost node of the right subtree answers when it exists; otherwise climb to the first ancestor that holds the node on its left.
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