Binary Search Tree : Lowest Common Ancestor

  • + 5 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.