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

Class PQ

src/common/priority_queue.rs:15–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13type Comparator<T> = Box<dyn Fn(&T, &T) -> bool>;
14
15pub struct PQ<T> {
16 pq: Vec<T>, // 为了计算方便, pq的index是从1开始计算的, 0号元素未被使用
17 n: usize,
18 comparator: Comparator<T>,
19}
20
21pub struct IndexPQ<T> {
22 // max_n: usize, // maximum number of elements on PQ

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected