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

Method new

src/graph/util/paths.rs:88–94  ·  view source on GitHub ↗
(g: &dyn IGraph, s: usize)

Source from the content-addressed store, hash-verified

86
87impl DepthFirstPaths {
88 pub fn new(g: &dyn IGraph, s: usize) -> Self {
89 let marked = vec![false; g.V()];
90 let edge_to = vec![0; g.V()];
91 let mut h = Self { marked, s, edge_to };
92 h.dfs(g, s);
93 h
94 }
95
96 fn dfs(&mut self, g: &dyn IGraph, v: usize) {
97 self.marked[v] = true;

Callers

nothing calls this directly

Calls 2

bfsMethod · 0.80
dfsMethod · 0.45

Tested by

no test coverage detected