Skip to content

Commit 6754788

Browse files
committed
fix code cov
1 parent c799144 commit 6754788

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

examples/graphs/hld_jump_on_path.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ fn main() {
2828
k: usize,
2929
}
3030

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+
3134
match hld.kth_on_path(u, v, k) {
3235
Some(w) => {
3336
assert!(k <= hld.dist(u, v));

src/graphs/hld.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ pub struct HLD {
3333
pub p: Vec<Option<usize>>,
3434
/// time in
3535
pub tin: Vec<usize>,
36-
d: Vec<usize>,
36+
/// depth
37+
pub d: Vec<usize>,
3738
ord: Vec<usize>,
3839
siz: Vec<usize>,
3940
head: Vec<usize>,

0 commit comments

Comments
 (0)