Suppose that I have a tree to traverse using a Depth First Search, and that my algorithm for traversing it looks something like this:
algorithm search(NODE):
Eric Lippert has created a number of posts about this subject. For example take a look at this one: Recursion, Part Two: Unrolling a Recursive Function With an Explicit Stack