FROM,
V.VIGNESH.


On 20 March 2012 17:58, Dheeraj Sharma <dheerajsharma1...@gmail.com> wrote:

> How to check if one binary tree is a sub tree of other?
> Any Solution other then bruteforce?
> Prototype
> bool check(node *t1,node *subtree)
>
> --
> Sent from my mobile device
>
> *Dheeraj Sharma*
>
> --
> 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.
>
>
Hai,

i got an idea using any of tree traversal methods(say inorder).

Perform inorder traversal of mail tree and sub tree.
store the results separately
compare the elements of sub tree elements with main tree elements.
it takes a for loop to compare the results.

Also i am a newbie to this. Any mistakes please pardon me.
Thank you.

-- 
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