Question DSA-TREE-0070
HardWhat is the time complexity of finding the lowest common ancestor of two nodes in a binary tree (no parent pointers) with a single recursive pass?
- A.
O(h²)
- B.
O(n)
- C.
O(n²)
- D.
O(log n)
Sign up free to see the answer and a step-by-step explanation.