[−][src]Struct algorithms_edu::algo::graph::AdjacencyList
Implementations
impl AdjacencyList[src]
pub fn bfs<T: Queue<usize>>(&self, start: usize) -> Vec<Option<usize>>[src]
Perform a breadth first search on a graph a starting node start.
pub fn reconstruct_path<T: Queue<usize>>(
&self,
start: usize,
end: usize
) -> Vec<usize>[src]
&self,
start: usize,
end: usize
) -> Vec<usize>
impl AdjacencyList[src]
pub fn dfs(&self, start: usize) -> usize[src]
Perform a depth first search on a graph with n nodes from a starting point to count the number of nodes in a given component.
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]
Auto Trait Implementations
impl RefUnwindSafe for AdjacencyList
impl Send for AdjacencyList
impl Sync for AdjacencyList
impl Unpin for AdjacencyList
impl UnwindSafe for AdjacencyList
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,