This question is from the book Introduction to Algorithms 3rd:
**Each node in the binary tree has 4 properties: key,left,right,parent
EDIT: The binary tree is stored as linked nodes that each one of them has the 4 properties I mentioned.
Write an O(n) time nonrecursive procedure that, given an n-node binary tree, prints out the key of each node. Use no more than constant extra space outside of the tree itself and do not modify the tree, even temporarily, during the procedure.
I tried to find a solution but got nothing...(Also I searched google for solutions for this book, but this question wasn't included there maybe because it was added in later versions).