Visualize hierarchical structures and traversals: Pre, In, Post, and Level order.
Variants
Left → Root → Right. Visits nodes in ascending order on a BST.
Root → Left → Right. Clones a tree or serialises expression trees.
Left → Right → Root. Bubble information up from children, the basis of every post-order pattern.
DFS the tree with a running sum; light up any root-to-leaf path that hits the target.
Recursive descent: if both subtrees return truthy at a node, that node is the LCA.
Variants
Level-order traversal that counts completed levels. Every fully drained queue level bumps the depth counter.