Back to Questions

Lowest Common Ancestor of a BST

74.7K viewsAsked at Apple
Easy

Question Explain

Given a Binary Search Tree (BST) and two nodes $p$ and $q$, find their Lowest Common Ancestor (LCA). Use the BST property to avoid full tree traversal.

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question
Lowest Common Ancestor of a BST - Interview Question