Skip to content

Commit

Permalink
Hashe w hld
Browse files Browse the repository at this point in the history
  • Loading branch information
BCzarkowski committed Mar 9, 2024
1 parent 6523d88 commit 4fba8f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/graph/hld/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 7,7 @@
* \texttt{get\_subtree(v)} zwraca przedział preorderów odpowiadający podrzewu v.
*/
struct HLD {
// BEGIN HASH
vector<vector<int>> &adj;
vector<int> sz, pre, pos, nxt, par;
int t = 0;
Expand All @@ -33,7 34,7 @@ struct HLD {
HLD(int n, vector<vector<int>> &_adj)
: adj(_adj), sz(n), pre(n), pos(n), nxt(n), par(n) {
init(0), set_paths(0);
}
} // END HASH
int lca(int v, int u) {
while(nxt[v] != nxt[u]) {
if(pre[v] < pre[u])
Expand Down

0 comments on commit 4fba8f9

Please sign in to comment.