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

Method add_edge

src/graph/directed/digraph.rs:21–26  ·  view source on GitHub ↗
(&mut self, v: usize, w: usize)

Source from the content-addressed store, hash-verified

19 }
20
21 fn add_edge(&mut self, v: usize, w: usize) {
22 // 因为是建立 "v -> w" 有方向的边,
23 // 此处只调用一次push_front, 不同于Graph
24 self.adj[v].push_front(w);
25 self.ne += 1;
26 }
27
28 fn adj(&self, v: usize) -> Iter<'_, usize> {
29 self.adj[v].iter()

Callers 2

reverseMethod · 0.45
fromMethod · 0.45

Calls 1

push_frontMethod · 0.80

Tested by

no test coverage detected