Skip to main content

bfs_order

Function bfs_order 

Source
pub fn bfs_order(graph: &[Vec<usize>], source: usize) -> Vec<usize>
Expand description

Return the visitation order of BFS starting from source.

The first element is always source. Each subsequent element is the next vertex dequeued from the BFS queue.

ยงPanics

Panics if source >= graph.len().