DotNetGnat
Programmer
Guys,
I have binary tree as follows
One Step
_________
A
/ \
B C
Two Steps
_________
A
/ \
B C
/ \ / \
D E E F
Three Steps
____________
A
/ \
B C
/ \ / \
D E E F
/ \ /\ /\ /\
G HH I H I I J
and so on...
I want to eliminate the duplicate nodes and result should like below:
One step
________
No Changes here
A
/ \
B C
Two Steps
___________
A
/ \
B C
/ \ / \
D E F
Three Steps
_____________
A
/ \
B C
/ \ / \
D E F
/ \ / \ / \
G H I J
I tried using InorderTraversal to relink the nodes but failed...any suggestions...
Thanks
-DNG
I have binary tree as follows
One Step
_________
A
/ \
B C
Two Steps
_________
A
/ \
B C
/ \ / \
D E E F
Three Steps
____________
A
/ \
B C
/ \ / \
D E E F
/ \ /\ /\ /\
G HH I H I I J
and so on...
I want to eliminate the duplicate nodes and result should like below:
One step
________
No Changes here
A
/ \
B C
Two Steps
___________
A
/ \
B C
/ \ / \
D E F
Three Steps
_____________
A
/ \
B C
/ \ / \
D E F
/ \ / \ / \
G H I J
I tried using InorderTraversal to relink the nodes but failed...any suggestions...
Thanks
-DNG