知识卡片
最近公共祖先取最深共同祖先
有根树中两节点的最近公共祖先,是同时为二者祖先且深度最大的节点。
这里的“最近”按共同祖先的深度衡量,不是按任一节点到它的边数单独衡量。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第19章 不相交集合的数据结构 · 查看原书依据
The lowest common ancestor of two nodes u and v in a rooted tree T is the node w that is an ancestor of both u and v and that has the greatest depth in T.
参考来源
- 位置:《算法导论(第4版)》第19章《不相交集合的数据结构》(OEBPS/chapter019.xhtml,文本字符[40000,45000))。
- 结论依据:原文给出最近公共祖先的共同祖先与最大深度定义。
- 原始内容:The lowest common ancestor of two nodes u and v in a rooted tree T is the node w that is an ancestor of both u and v and that has the greatest depth in T .