
July 5th, 2003, 01:18 AM
|
 |
Junior Member
|
|
Join Date: Jul 2003
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Hmm i have no idea.. but pseudocode for checking structure of two trees such as a binary tree would be as follows
Code:
checksame(tree1,tree2)
if(t1 is empty AND t2 is empty)
return true
if(t1 is empty OR t2 is empty)
return false
return true AND checksame(t1.right,t2.left) AND checksame(t2.left,t2.right)
|