If two binary search tree is given how do i check if one is sub tree of other. Is the same algorithm that checks if one tree is the sub tree of other true in this case ?
Algo from here Find whether a tree is a subtree of other
Traverse T1. If the current node is equal to the root node of T2, traverse both of the trees (T2 and the current subtree of T1) at the same time. Compare the current node. If they are always equal, T2 is a subtree of T1
Kindly suggest