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

Class TopM

src/common/top_m.rs:6–9  ·  view source on GitHub ↗

Find the largest M integers. This implementation uses a MinPQ of size at most m + 1 to identify the M largest elements.

Source from the content-addressed store, hash-verified

4/// This implementation uses a MinPQ of size
5/// at most m + 1 to identify the M largest elements.
6pub struct TopM<T> {
7 pq: PQ<T>,
8 m: usize,
9}
10
11impl<T: PartialOrd + Default> TopM<T> {
12 pub fn new(m: usize) -> Self {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected