The Quest Begins (The "Why")

I still remember the first time I was asked to validate a binary search tree in an interview. My brain went into panic mode: “Do I write recursion? What if the tree is skewed and I blow the call stack? Is there a way to do it iteratively without turning my code into spaghetti?” I felt like Neo staring at the green code rain, wondering if there was a hidden pattern I could see.

The truth is, most of us learn tree traversals as a rote recipe: “visit left, node, right” for inorder, and we copy‑paste the recursive version without ever asking why it works. When the interviewer nudges you toward an iterative solution, the panic spikes because the recursion we love suddenly feels like a crutch. That moment—when you realize you need to understand the mechanics behind the call stack—is the real quest.

The Revelation (The Insight)

Here’s the magic: a recursive traversal is just a depth‑first walk where the call stack keeps track of where we need to return after exploring a subtree. If we can mimic that stack ourselves with an explicit data structure, we get the same order without relying on function calls.