problem: https://practice.geeksforgeeks.org/problems/check-if-subtree/1
my solution: https://ide.codingblocks.com/s/468854
problem: https://practice.geeksforgeeks.org/problems/check-if-subtree/1
my solution: https://ide.codingblocks.com/s/468854
it means this code will work if both the tree is bst?
it will work for all such tree whose all nodes will have distint values
this approach will remain O(n^2).
read the ediotrial given in the problem for O(N) approach
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.