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

Method from

src/graph/undirected/graph.rs:110–117  ·  view source on GitHub ↗
(nv: usize)

Source from the content-addressed store, hash-verified

108/// create a V-vertex graph with no edges
109impl From<usize> for Graph {
110 fn from(nv: usize) -> Self {
111 let mut adj = Vec::with_capacity(nv);
112 for _ in 0..nv {
113 adj.push(LinkedList::default());
114 }
115
116 Self { nv, ne: 0, adj }
117 }
118}
119
120impl From<&str> for Graph {

Callers

nothing calls this directly

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