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

Function main

code/chapter07/binary_heap.rs:166–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

164}
165
166fn main() {
167 let mut bh = BinaryHeap::new();
168 let nums = [-1,0,2,3,4];
169 bh.push(10); bh.push(9);
170 bh.push(8); bh.push(7); bh.push(6);
171
172 bh.build_add(&nums);
173 println!("empty: {:?}", bh.is_empty());
174 println!("min: {:?}", bh.min());
175 println!("pop min: {:?}", bh.pop());
176
177 bh.build_new(&nums);
178 println!("size: {:?}", bh.len());
179 println!("pop min: {:?}", bh.pop());
180}

Callers

nothing calls this directly

Calls 3

pushMethod · 0.45
build_addMethod · 0.45
build_newMethod · 0.45

Tested by

no test coverage detected