摘要: 题目链接:https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-search-tree/ 题目描述: 题解: /** * Definition for a binary tree node. * struct Tree 阅读全文
posted @ 2021-02-21 20:17 张宵 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-tree 题目描述: 给定一个二叉树, 找到该树中两个指定节点的最近公共祖先。 百度百科中最近公共祖先的定义为:“对于有根树 T 的两个节点 p、q,最近 阅读全文
posted @ 2021-02-21 19:55 张宵 阅读(51) 评论(0) 推荐(0) 编辑