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

Function pop

tests/test_common_heap.rs:36–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35#[test]
36fn pop() {
37 let t = vec![4, 1, 3, 2, 16, 9, 10, 14, 8, 7];
38 let mut heap = max_heap::BinaryHeap::new(t);
39 for v in vec![16, 14, 10, 9, 8, 7, 4, 3, 2, 1] {
40 assert_eq!(heap.pop(), Some(v));
41 }
42 assert_eq!(heap.pop(), None);
43}
44
45#[test]
46fn set() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected