Binary Search Tree : Lowest Common Ancestor

  • + 0 comments

    the second loop should be checking if the cur is less than v1 and v2 because if we had 8 , 11, 10, 12, 9, 13 and v1 = 9, v2 =13 your loops would return 8 which is wrong.