You are viewing a single comment's thread. Return to all comments →
for example, for a tree: 4 2 3 1 7 6 8
if you want to find the lowest common ancestor of 6 and 8, your code outputs 7, but the correct answer should be 4!
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 →
for example, for a tree: 4 2 3 1 7 6 8
if you want to find the lowest common ancestor of 6 and 8, your code outputs 7, but the correct answer should be 4!