midBinary Tree
Lowest Common Ancestor (LCA) in BT
Updated Apr 28, 2026
Short answer
The deepest node that is an ancestor to both target nodes.
Deep explanation
Mid-level dive into Lowest Common Ancestor (LCA) in BT. Discussing recursion vs iteration and auxiliary space.
Real-world example
Router path optimization.
Common mistakes
- Ignoring the null case for leaf children.
Follow-up questions
- Time Complexity?