To check if the given tree is subtree of another tree, first we need to undertand if the how can we check if the tree's are identical or not.
Please visit: Check if two Binary Trees are Identical or not?
To verify if a tree is subtree of another, we need to traverse the Tree T in a preorder fashion.For every visited node in the traversal, see if the subtree rooted with this node is identical to another tree S.
Please visit: Check if two Binary Trees are Identical or not?
To verify if a tree is subtree of another, we need to traverse the Tree T in a preorder fashion.For every visited node in the traversal, see if the subtree rooted with this node is identical to another tree S.






