How to traverse a threaded binary tree non recursively in O(n) without using a stack (just allowed to use constant extra space for temp variables, so we can't add visit flag to each node in the tree). I spent a good time thinking about it but it just doesn't seem to me to be doable unless we are going to traverse the memory locations that have the tree data. Let's say that we are using multiple array representation to implement pointers, then we can traverse the tree in O(n), does anyone have something else in mind?
Note This is not homework, just to save the energy of some keyboard strokes to write comments about homework!