We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c799144 commit 6754788Copy full SHA for 6754788
examples/graphs/hld_jump_on_path.rs
@@ -28,6 +28,9 @@ fn main() {
28
k: usize,
29
}
30
31
+ assert_eq!(hld.kth_par(u, hld.d[u]), Some(0));
32
+ assert_eq!(hld.kth_par(u, hld.d[u] + 1), None);
33
+
34
match hld.kth_on_path(u, v, k) {
35
Some(w) => {
36
assert!(k <= hld.dist(u, v));
src/graphs/hld.rs
@@ -33,7 +33,8 @@ pub struct HLD {
pub p: Vec<Option<usize>>,
/// time in
pub tin: Vec<usize>,
- d: Vec<usize>,
+ /// depth
37
+ pub d: Vec<usize>,
38
ord: Vec<usize>,
39
siz: Vec<usize>,
40
head: Vec<usize>,
0 commit comments