Recursive binary tree traversals have been documented everywhere and is quite trivial to solve. After a bit of web crawling, my favorite article documenting this was found here.
Non Recursive tree traversal is much more complicated than its recursive counterpart and requires a stack. Every time we decide to postpone an operation on a node, we need to push that node onto the stack.
Order: Left, Right, Root.
Key: In addition to a stack, we need two pointers - a current node and previous node pointer that help us determine which direction we are traversing. The direction will help us as follows:
The algorithm without error handling: