You are viewing a single comment's thread. Return to all comments →
A bit confusing for this and I found a counter example.
I had a tree: 8 4 9 1 6 2 5 7 3
lca of 2 and 3 should be 2, but this logic return 1
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 →
A bit confusing for this and I found a counter example.
I had a tree: 8 4 9 1 6 2 5 7 3
lca of 2 and 3 should be 2, but this logic return 1