| 19 | } |
| 20 | |
| 21 | pub 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 | |
| 30 | impl<T: PartialOrd + Default> PQ<T> { |
| 31 | /// The MinPQ represents a priority queue of generic keys. |
nothing calls this directly
no outgoing calls
no test coverage detected