Coding Interview PatternsLowest Common Ancestor of a Binary Tree
MediumTree Depth-First Search

Lowest Common Ancestor of a Binary Tree

Explanation & Solution

Description

Given a binary tree, find the lowest common ancestor of two given nodes in the tree.