Suppose there is a tree:
1
/
2 3
/
4 5
Then the mirror image will be:
1
/
3 2
/
5 4
Assume the nodes are of this structure:
struct node{
node left;
node right;
int value;
}
Can someone suggest an algorithm for this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…