How to traverse a binary tree whose nodes only contain a father field. e.g.
struct NodeType {
int data;
int father;
};
A left son's father field has a negative value and right son's father field has +ve value. Absolute value of the father field points to the father of the node.
Such tree can be traversed only in an upward direction but i cannot reach all nodes starting at a leaf. Once all nodes reachable from a leaf are traversed, i get stuck. What i can make out is that while constructing the tree, i will need to keep track of more than just one leaf so that i can traverse all nodes of the binary tree
Want to know an algorthm for this
Am tryng to solve a data-structure exercise in aarom m. tenebaum --5.2.4