I\'m looking at an interview book and the question is:
You have two very large binary trees: T1, with millions of nodes, and T2
T1
T2
I think it is not true. Consider:
T2: 2 / \ 1 3 inorder 123 preorder 213
and
T1: 0 / \ 3 3 / \ 1 1 / \ 0 2 inorder 0123103 preorder 0310213
123 is substring of 0123103, 213 is substring of 0310213, but T2 is not subtree of T1.
123
0123103
213
0310213