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 pricingWalk in-order with constant extra memory by borrowing each node's empty right pointer as a way back.
What this asks
Walk a binary tree in order with constant extra memory.
Before stepping left, tie the rightmost node of the left subtree back to the current node; the thread is untied when the walk returns through it.
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