Cant solve it Please help
Hi Anmol,
u can refer my soln https://ide.codingblocks.com/s/637636
Hope it will clear all ur doubts…
i hope ur doubt is cleared now??
I cant understand please explain this, it will be really helpful and please tell me the time and space
Hi, so all the question asks is u are given 2 node values and u have to find if they are cousins of each other or not… so two nodes are cousins if firstly they are present at the same level in tree and secondly they are not children of same nodes…
coming to time and space complexity we are doing a normal tree traversal so time complexity comes out to be O(N) and constant space is being used so space complexity is O(1)…
Hi Anmol,
i hope its clear now??
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.