← ALL NOTES
Stack

144. Binary Tree Preorder Traversal

Preorder — root, then left, then right — done iteratively with an explicit stack. The recursion is a one-liner, so the only thing that makes this interesting is the trick for reproducing the exact…

Loading…