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

Class IndexPQ

src/common/priority_queue.rs:21–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21pub struct IndexPQ<T> {
22 // max_n: usize, // maximum number of elements on PQ
23 n: usize, // number of elements on PQ
24 pq: Vec<i32>, // binary heap using 1-based indexing
25 qp: Vec<i32>, // inverse of pq, qp[pq[i]] = pq[qp[i]] = i
26 keys: Vec<Option<T>>,
27 comparator: Comparator<Option<T>>,
28}
29
30impl<T: PartialOrd + Default> PQ<T> {
31 /// The MinPQ represents a priority queue of generic keys.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected