pub struct Hld {
pub parent: Vec<Option<usize>>,
pub depth: Vec<usize>,
pub size: Vec<usize>,
pub head: Vec<usize>,
pub pos: Vec<usize>,
}Expand description
Heavy-Light Decomposition over a rooted tree.
Fields§
§parent: Vec<Option<usize>>Parent of each vertex in the rooted tree. None for the root.
depth: Vec<usize>Depth of each vertex (root has depth 0).
size: Vec<usize>Subtree size of each vertex (including itself).
head: Vec<usize>Head of the heavy chain containing each vertex.
pos: Vec<usize>Position of each vertex in the linearised order of chains.
Implementations§
Source§impl Hld
impl Hld
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Hld
impl RefUnwindSafe for Hld
impl Send for Hld
impl Sync for Hld
impl Unpin for Hld
impl UnsafeUnpin for Hld
impl UnwindSafe for Hld
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more