网站首页  英汉词典

请输入您要查询的英文单词:

 

单词 Lowest common ancestor
释义

Lowest common ancestor

中文百科

最近公共祖先 (图论)

在图论和计算机科学中,最近公共祖先是指在一个树或者有向无环图中同时拥有vw作为后代的最深的节点。在这里,我们定义一个节点也是其自己的后代,因此如果vw的后代,那幺w就是vw的最近公共祖先。

最近公共祖先是两个节点所有公共祖先中离根节点最远的,计算最近公共祖先和根节点的长度往往是有用的。比如为了计算树中两个节点vw之间的距离,可以使用以下方法:分别计算由v到根节点和w到根节点的距离,两者之和减去最近公共祖先到根节点的距离的两倍即可得到vw的距离。

英语百科

Lowest common ancestor 最近公共祖先 (图论)

In this tree, the lowest common ancestor of the nodes x and y is marked in dark green. Other common ancestors are shown in light green.
A DAG with the common ancestors of x and y in light green, and their lowest common ancestors in dark green.

In graph theory and computer science, the lowest common ancestor (LCA) of two nodes v and w in a tree or directed acyclic graph (DAG) T is the lowest (i.e. deepest) node that has both v and w as descendants, where we define each node to be a descendant of itself (so if v has a direct connection from w, w is the lowest common ancestor).

随便看

 

英汉网英语在线翻译词典收录了3779314条英语词汇在线翻译词条,基本涵盖了全部常用英语词汇的中英文双语翻译及用法,是英语学习的有利工具。

 

Copyright © 2004-2024 encnc.com All Rights Reserved
更新时间:2025/6/23 22:20:38