Concept Flow - Lowest Common Ancestor in Binary Tree
Start at root node
Check if root is null or matches p or q
Yes
Return root
No
Recurse left subtree
Recurse right subtree
If left and right both non-null
Return root as LCA
Return non-null child (left or right)
Start from root, check if root is p or q or null, else recurse left and right. If both sides return nodes, root is LCA. Otherwise return the non-null side.
