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

Method new_max_pq

src/common/priority_queue.rs:46–49  ·  view source on GitHub ↗

The MaxPQ represents a priority queue of generic keys. It supports the usual insert and delete-the-max operations, along with methods for peeking at the max key, testing if the priority queue is empty, and iterating through the keys.

(cap: usize)

Source from the content-addressed store, hash-verified

44 /// testing if the priority queue is empty, and iterating through
45 /// the keys.
46 pub fn new_max_pq(cap: usize) -> Self {
47 let comparator = Box::new(|a: &T, b: &T| a.lt(b));
48 Self::new(cap, comparator)
49 }
50
51 fn new(cap: usize, comparator: Comparator<T>) -> Self {
52 let mut pq = Self {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected