You are viewing a single comment's thread. Return to all comments →
def lca(root, v1, v2): #Enter your code here if v1< root.info and v2 root.info and v2>root.info: return lca(root.right, v1, v2) else: return root
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 →
def lca(root, v1, v2): #Enter your code here if v1< root.info and v2 root.info and v2>root.info: return lca(root.right, v1, v2) else: return root