It may be done like,

   - Read one tree and hold the values in a array A.
   - While reading the other tree start XORing with the values in the array
   A
   - If the array A is completely empty in the end then we can assume both
   the trees are isomorphic.


Hope this could be a solution.


On Sat, Aug 27, 2011 at 10:35 PM, bugaboo <bharath.sri...@gmail.com> wrote:

> Considering the definition of binary tree isomorphism is the
> following:
> - 2 binary trees are isomorphic if they have the same structure but
> differ just by values.
>
> What is the logic (or pseudo code) for checking if two binary trees
> are isomorphic?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
Thanks and Regards,
Raghavan KL

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to