Binary Search Tree : Lowest Common Ancestor

  • + 1 comment

    Example BST is not a BST, right child of 2 should be 4, not 3. Please fix this confusion! Correct example for 1,2,3,4,5,6 with 2 as root is follows, which means LCA for 4 and 6 would be 2:

       2
      / \
     1   4
        / \
       3   5
             \
              6