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

Function main

publication/code/chapter08/binary_heap.rs:163–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

pushMethod · 0.45
build_addMethod · 0.45
build_newMethod · 0.45

Tested by

no test coverage detected