Struct lctree::LinkCutTree

source ·
pub struct LinkCutTree<T: Path> { /* private fields */ }

Implementations§

source§

impl<T: Path> LinkCutTree<T>

source

pub fn new() -> Self

source

pub fn make_tree(&mut self, weight: f64) -> usize

source

pub fn connected(&mut self, v: usize, w: usize) -> bool

Checks if v and w are connected in the forest.

Creates a link between two nodes in the forest (where w is the parent of v).

source

pub fn cut(&mut self, v: usize, w: usize)

Cuts the link between nodes v and w (if it exists)

source

pub fn path(&mut self, v: usize, w: usize) -> T

Performs path aggregation on a path between v and w (if they are connected)

source

pub fn findroot(&mut self, v: usize) -> usize

Finds the root of the tree that v is in.

source§

impl LinkCutTree<FindMax>

source

pub fn findmax() -> Self

source§

impl LinkCutTree<FindMin>

source

pub fn findmin() -> Self

source§

impl LinkCutTree<FindSum>

source

pub fn findsum() -> Self

Trait Implementations§

source§

impl Default for LinkCutTree<FindMax>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for LinkCutTree<T>where T: RefUnwindSafe,

§

impl<T> Send for LinkCutTree<T>where T: Send,

§

impl<T> Sync for LinkCutTree<T>where T: Sync,

§

impl<T> Unpin for LinkCutTree<T>where T: Unpin,

§

impl<T> UnwindSafe for LinkCutTree<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.