In this video, I have discussed about finding a binary tree in another binary tree, i.e finding whether a given tree is subtree of other tree.
Problem Statement: Given two binary trees T1 and T2, check whether T2 is subtree of T1.
The algorithm is traversing a binary tree level order, whenever a node is equal to the root node of subtree, we call for isIdentical function.
Practice questions:
1) Geeks for Geeks: https://practice.geeksforgeeks.org/problems/check-if-subtree/1
I hope you liked my video, do subscribe to my channel to get the updates of my latest uploads.
#binarytree #datastrucuture #algorithm #interviewquestions #subtree #identical