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

Method dfs

src/graph/undirected/cc.rs:70–79  ·  view source on GitHub ↗
(&mut self, g: &dyn IGraph, v: usize)

Source from the content-addressed store, hash-verified

68
69impl CC {
70 fn dfs(&mut self, g: &dyn IGraph, v: usize) {
71 self.marked[v] = true;
72 self.id[v] = self.count;
73 self.size[self.count] += 1;
74 for &w in g.adj(v) {
75 if !self.marked[w] {
76 self.dfs(g, w);
77 }
78 }
79 }
80}

Callers 1

newMethod · 0.45

Calls 1

adjMethod · 0.45

Tested by

no test coverage detected