title: Iterative depth-first tree traversal with pre- and post-visit at each node
body: <p>Can anyone point me at pseudocode for iterative depth-first tree traversal, where it's possible to do actions on each node at both pre- and post- order? </p>
  
  <p>That is, an action before decent into a node's children, then an action after ascent from the children?</p>
  
  <p>Also, my tree is not binary - each node has 0..n children.</p>
  
  <p>Basically, my case is transforming a recursive traversal, where I do the pre- and post- operations on the current node, either side of the recursion into the children.</p>