Amazon interview question

find whether a tree is subtree or not