MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / add_neighbor

Method add_neighbor

publication/code/chapter09/graph_adjlist.rs:30–32  ·  view source on GitHub ↗
(&mut self, nbr: T, wt: i32)

Source from the content-addressed store, hash-verified

28 }
29
30 fn add_neighbor(&mut self, nbr: T, wt: i32) {
31 self.neighbors.push((nbr, wt));
32 }
33
34 // 获取相邻的点集合
35 fn get_neighbors(&self) -> Vec<&T> {

Callers 1

add_edgeMethod · 0.45

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected