Problem: Given a binary tree, formulate an algorithm to traverse the nodes of the binary tree without using recursion for the following modes:
- pre-order traversal
- in-order traversal
- post-order traversal
Now, before we go any further, you may ask me why is this of paramount importance to find a proper non-recursive solution to this academic problem. And my response is... well it just makes me sleep well tonight blogging about this. ;) (Also hoping that Google would take notice and ahem... check out my CV).
So here goes:
No comments:
Post a Comment