Given a binary tree with an integer, Left & Right pointers, how can one traverse the tree in O(n) time and O(1) extra memory (no stack/queue/recursion)?
This guy gave a solution which is not O(n) total time that encoded the current path as an integer (and thus works on for trees of limited depth).
I am looking for the classical solution
(SPOILER)
that encoded the parent of each node in the children.