CPSC 490 Finale
Heavy-Light Decomposition and Suffix Array
Lucca Siaudzionis and Jack Spalding-Jamieson 2020/04/07
University of British Columbia
CPSC 490 Finale Heavy-Light Decomposition and Suffix Array Lucca - - PowerPoint PPT Presentation
CPSC 490 Finale Heavy-Light Decomposition and Suffix Array Lucca Siaudzionis and Jack Spalding-Jamieson 2020/04/07 University of British Columbia Announcements firt Congrats on [basically] finishing the course! Last reminder that
University of British Columbia
1
1 5 3 2 4 3 3 −3 6 −2 1 −1
2
3
4
5
6
7
1 void compute_size(vector<int>& size, int v, vector<vector<int>>& adj) { 2
3
4
5
6
7
8
9 } 10 // next stores the next vertex that is the root or is connected by a light edge to its parent 11 // next[root] must be initialized to root 12 void hld(int v, vector<vector<int>>& adj, vector<int>& next) { 13
14
15
16
17 }
8
19
20
21
22
23
24
25
26
27
28
29
9
10
11
12
13
14
15
16
17
18
19
20
21
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
22
23
1
2
3
4
5
6
7
8
9
10
11
24
25
26
27
28
29