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

Method from

src/graph/directed/digraph.rs:47–54  ·  view source on GitHub ↗
(nv: usize)

Source from the content-addressed store, hash-verified

45/// create a V-vertex graph with no edges
46impl From<usize> for Digraph {
47 fn from(nv: usize) -> Self {
48 let mut adj = Vec::with_capacity(nv);
49 for _ in 0..nv {
50 adj.push(LinkedList::default());
51 }
52
53 Self { nv, ne: 0, adj }
54 }
55}
56
57impl From<&str> for Digraph {

Callers 2

dfsMethod · 0.45
checkMethod · 0.45

Calls 5

pushMethod · 0.80
get_vMethod · 0.80
get_edgesMethod · 0.80
parseFunction · 0.50
add_edgeMethod · 0.45

Tested by

no test coverage detected