MediumTrees
Lowest Common Ancestor of BST
Find LCA in binary search tree
Solution Approach
Use BST property
Complexity Analysis
Time Complexity
O(h)Space Complexity
O(1)Complexity
Time:O(h)
Space:O(1)
Asked at
GoogleAmazonMicrosoft
Find LCA in binary search tree
Use BST property
Time Complexity
O(h)Space Complexity
O(1)