[][src]Struct algorithms_edu::graph::AdjacencyList

pub struct AdjacencyList { /* fields omitted */ }

Implementations

impl AdjacencyList[src]

pub fn with_size(n: usize) -> Self[src]

Initialize an empty adjacency list that can hold up to n nodes.

pub fn len(&self) -> usize[src]

Number of nodes

pub fn is_empty(&self) -> bool[src]

pub fn add_directed_edge(&mut self, u: usize, v: usize, cost: i32)[src]

Add a directed edge from node u to node v with cost cost.

pub fn add_undirected_edge(&mut self, u: usize, v: usize, cost: i32)[src]

Add an undirected edge between nodes u and v.

pub fn add_unweighted_undirected_edge(&mut self, u: usize, v: usize)[src]

Add an undirected unweighted edge between nodes u and v. The edge added will have a weight of 1 since its intended to be unweighted.

Trait Implementations

impl Index<usize> for AdjacencyList[src]

type Output = Vec<Edge>

The returned type after indexing.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.