Is it possible to iterate over a binary tree in O(1) auxiliary space (w/o using a stack, queue, etc.), or has this been proven impossible? If it is possible, how can it be
Is it possible to iterate over a binary tree in O(1) auxiliary space.
struct node { node * father, * right, * left; int value; };
This structure will make you be able to move 1-step in any direction through the binary tree. But still in iteration you need to keep the path!