MCPcopy Create free account
hub / github.com/douchuan/algorithm / new

Method new

src/graph/undirected/dfs.rs:23–30  ·  view source on GitHub ↗
(g: &dyn IGraph, s: usize)

Source from the content-addressed store, hash-verified

21
22impl DepthFirstSearch {
23 pub fn new(g: &dyn IGraph, s: usize) -> Self {
24 let mut dfs = Self {
25 marked: vec![false; g.V()],
26 count: 0,
27 };
28 dfs.dfs(g, s);
29 dfs
30 }
31
32 /// is v connected to s?
33 pub fn marked(&self, v: usize) -> bool {

Callers

nothing calls this directly

Calls 1

dfsMethod · 0.45

Tested by

no test coverage detected