↓快轉到主要內容

Binary-Lifting

LeetCode 236: Lowest Common Ancestor of a Binary Tree
·1 分鐘
LeetCode Medium Tree Depth-First-Search Binary-Tree Binary-Lifting
LeetCode 236 解題筆記:遞迴回傳子樹裡找到的 p 或 q;左右都找到代表在這裡分岔,這個節點就是 LCA