Skip to content

Commit

Permalink
Update lca.md
Browse files Browse the repository at this point in the history
完善lca各算法比较
  • Loading branch information
CurryWOE authored Oct 30, 2023
1 parent b859010 commit 8fac22c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/Graph/lca.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
最近公共祖先简称 LCA(Lowest Common Ancestor)。两个节点的最近公共祖先,就是这两个点的公共祖先里面,离根最远的那个。

## 各种算法使用场合
树剖相比倍增,预处理复杂度低,询问常数小
倍增优点:代码短,是可以维护动态加叶子的树;缺点:不能修改

树剖优点:比倍增快,支持修改;缺点:代码长

tarjan处理离线询问最快
## 题目
Expand Down

0 comments on commit 8fac22c

Please sign in to comment.