You are viewing a single comment's thread. Return to all comments →
I think in this counter example it wouldnt work:
v1 is 1 and v2 is 7
4 / \ 2 6 \ / \ 3 5 7 / 1
Answer we would get is 4 and the correct answer is 6.
Seems like cookies are disabled on this browser, please enable them to open this website
Binary Search Tree : Lowest Common Ancestor
You are viewing a single comment's thread. Return to all comments →
I think in this counter example it wouldnt work:
v1 is 1 and v2 is 7
Answer we would get is 4 and the correct answer is 6.