Correction I think we are not the value 7 actually we are returning the Node which contains value 7 i Know for some this might be same thing but for beginners it can get a little bit confusing
Well, we are not avoiding recursion when the node is found isnt it? For example: getKthAncestor( root, 7, 1); will still undergo recursion for 2->right because 4 is returning NULL to 2, right?
Hi cpp nuts Is there any other way to become a patreon because my card was disabled for international transactions if you have any other way pls tell me I have also contacted my bank 🏦 they need more than a month .
Best solution till now present on youtube
Thanks
Good Solution...
very nice and , very clear explanation sir thank you
Thanks and welcome
Correction I think we are not the value 7 actually we are returning the Node which contains value 7 i Know for some this might be same thing but for beginners it can get a little bit confusing
Nice Explanation 😊
Glad you liked it
thanks!!!!!
Got confused returning root at line 26 will work I was in an impression it may give false alarm to parent cl that we found the target
Well, we are not avoiding recursion when the node is found isnt it?
For example: getKthAncestor( root, 7, 1); will still undergo recursion for 2->right because 4 is returning NULL to 2, right?
I think removing the "return NULL;" when "k==0" should do the trick?
Hi cpp nuts
Is there any other way to become a patreon because my card was disabled for international transactions if you have any other way pls tell me I have also contacted my bank 🏦 they need more than a month .
Thanks for the consideration, but no man i don't know any other way..
@@CppNuts ok sir thanks