summaryrefslogtreecommitdiff
path: root/graph
diff options
context:
space:
mode:
authorGloria Mundi <gloria@gloria-mundi.eu>2024-02-27 13:05:43 +0100
committerGloria Mundi <gloria@gloria-mundi.eu>2024-02-27 13:05:43 +0100
commit19ad8dd96a237d4f55a58d9dc13fed0eea532641 (patch)
treea105b7fafb1a56f330d5560bf3c98361311313c3 /graph
parente09410a14cee2ac5a6e415a4fc8233edcecdf82f (diff)
delete duplicate sparse table LCA
Diffstat (limited to 'graph')
-rw-r--r--graph/LCA.cpp24
1 files changed, 0 insertions, 24 deletions
diff --git a/graph/LCA.cpp b/graph/LCA.cpp
deleted file mode 100644
index 7debf8f..0000000
--- a/graph/LCA.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-vector<vector<int>> adj();
-vector<int> visited();
-vector<int> first();
-vector<int> depth();
-
-void initLCA(int gi, int d, int& c) {
- visited[c] = gi, depth[c] = d, first[gi] = min(c, first[gi]), c++;
- for(int gn : adj[gi]) {
- initLCA(gn, d+1, c);
- visited[c] = gi, depth[c] = d, c++;
-}}
-
-int getLCA(int a, int b) {
- return visited[query(min(first[a], first[b]), max(first[a], first[b]))];
-}
-
-void exampleUse() {
- int c = 0;
- visited = vector<int>(2*sz(adj));
- first = vector<int>(sz(adj), 2*sz(adj));
- depth = vector<int>(2*sz(adj));
- initLCA(0, 0, c);
- init(depth);
-}