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 pricingAdapt the threaded walk so each node is visited on the way down instead of between its subtrees.
What this asks
Get the same memory saving for the preorder walk.
Visit each node on the first arrival; the threaded predecessor is stepped over instead of into, and the thread is removed in the same pass.
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