summaryrefslogtreecommitdiff
path: root/graph/LCA_sparse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'graph/LCA_sparse.cpp')
-rw-r--r--graph/LCA_sparse.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/graph/LCA_sparse.cpp b/graph/LCA_sparse.cpp
index 649e697..3e87cde 100644
--- a/graph/LCA_sparse.cpp
+++ b/graph/LCA_sparse.cpp
@@ -10,16 +10,16 @@ struct LCA {
first.assign(sz(adj), 2 * sz(adj));
idx = 0;
dfs(adj, root);
- st.init(&depth);
+ st.init(depth);
}
- void dfs(vector<vector<int>>& adj, int v, ll d=0, int p=-1) {
+ void dfs(vector<vector<int>>& adj, int v, ll d=0) {
visited[idx] = v, depth[idx] = d;
first[v] = min(idx, first[v]), idx++;
for (int u : adj[v]) {
if (first[u] == 2 * sz(adj)) {
- dfs(adj, u, d + 1, v);
+ dfs(adj, u, d + 1);
visited[idx] = v, depth[idx] = d, idx++;
}}}