正在加载……
← 返回 amazon 的题目列表
Lowest Common Ancestor of a Binary Tree
类型:online_judge
Given the root of a binary tree and two nodes p and q in the tree, find the lowest common ancestor (LCA) of the two nodes. Example Input 3 5 1 6 null 2 null null null 7 4 5 1