摘要: 1. 定义: LCA(Least Common Ancestors),即最近公共祖先,是指在有根树中,找出某两个结点 \(x\) 和 \(y\) 最近的公共祖先(深度最大的祖先),记为:\(LCA(x,y)\)。 举例: \(LCA(15,12)=4\) \(LCA(10,12)=10\) 图例: 阅读全文
posted @ 2022-05-28 17:04 Black--Panda 阅读(44) 评论(0) 推荐(0) 编辑