DIY: Lowest Common Ancestor of a Binary Tree
Problem statement
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.
Input
The first ...
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy