JuniorJunior (1–3 yrs)CodingPythonAmazonFacebook
Lowest Common Ancestor of BST
Find the lowest common ancestor of two nodes p and q in a BST (both exist in the tree).
Answers use simple, clear English.
Time: O(h)Space: O(1)
Confidence
#bst#lca
Find the lowest common ancestor of two nodes p and q in a BST (both exist in the tree).
Answers use simple, clear English.