Skip to content

Commit 63c5a61

Browse files
committed
initial reorg
1 parent 225ab92 commit 63c5a61

15 files changed

+7
-52
lines changed

library/trees/centroid_decomp_uncommon/count_paths_per_length.hpp

Lines changed: 0 additions & 44 deletions
This file was deleted.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
//! returns 1 if v is in u's subtree
22
bool in_subtree(int u, int v) {
3-
return in[u] <= in[v] && in[v] < in[u] + siz[u];
3+
return tin[u] <= tin[v] && tin[v] < tin[u] + siz[u];
44
}

library/trees/lca_rmq/next_on_path.hpp renamed to library/trees/extra_members/next_on_path.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@
55
//! @space O(1)
66
int next_on_path(int u, int v) {
77
assert(u != v);
8-
return in_subtree(u, v) ? rmq.query(in[u] + 1, in[v] + 1)
9-
: p[u];
8+
return in_subtree(u, v) ? rmq.query(tin[u] + 1, tin[v] + 1) : p[u];
109
}

library/trees/extra_members/compress_tree.hpp renamed to library/trees/extra_members/virtual_tree.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! @time O(|subset| log |subset|)
1212
//! @space O(|subset|)
1313
array<vi, 2> compress_tree(vi subset) {
14-
auto proj = [&](int v) { return in[v]; };
14+
auto proj = [&](int v) { return tin[v]; };
1515
ranges::sort(subset, {}, proj);
1616
int len = sz(subset);
1717
rep(i, 1, len)

library/trees/lca_rmq/lca_rmq.hpp renamed to library/trees/lca_rmq.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
// NOLINTNEXTLINE(readability-identifier-naming)
1515
struct LCA {
1616
int n;
17-
vi in, siz, d, p;
17+
vi tin, siz, d, p;
1818
RMQ<int, function<int(int, int)>> rmq = {{}, NULL};
1919
LCA(const auto& adj):
20-
n(sz(adj)), in(n), siz(n, 1), d(n), p(n) {
20+
n(sz(adj)), tin(n), siz(n, 1), d(n), p(n) {
2121
vi order;
2222
auto dfs = [&](auto&& self, int v) -> void {
23-
in[v] = sz(order), order.push_back(v);
23+
tin[v] = sz(order), order.push_back(v);
2424
for (int u : adj[v])
2525
if (u != p[v])
2626
d[u] = d[p[u] = v] + 1, self(self, u),
@@ -32,7 +32,7 @@ struct LCA {
3232
}
3333
int lca(int u, int v) {
3434
if (u == v) return u;
35-
auto [x, y] = minmax(in[u], in[v]);
35+
auto [x, y] = minmax(tin[u], tin[v]);
3636
return p[rmq.query(x + 1, y + 1)];
3737
}
3838
#include "../extra_members/dist_edges.hpp"
File renamed without changes.

0 commit comments

Comments
 (0)