I want to find out whether binary tree T2 is a subtree of of binary tree T1. I read that one could build string representations for T2 and T1 using pre-order and in-
Na...This approach is not correct.Because, different trees can have same traversal . For instance here in the given example, the tree is
26
/ \
10 3
/ \ \
4 6 3
\
30
and the candidate subtrees are
10
/ \
4 6
\
30
and
30
/ \
4 10
\
6
have the same inorder traversal as 4,30,10,6 but the second one isn't subtree