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

Method new

src/common/top_m.rs:12–17  ·  view source on GitHub ↗
(m: usize)

Source from the content-addressed store, hash-verified

10
11impl<T: PartialOrd + Default> TopM<T> {
12 pub fn new(m: usize) -> Self {
13 Self {
14 pq: PQ::new_min_pq(m + 1),
15 m,
16 }
17 }
18
19 pub fn insert(&mut self, v: T) {
20 self.pq.enqueue(v);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected