tov/min-max-heap-rs

A double-ended priority queue

Rust

43

127 commits

updated Jan 28, 2025

See the code

README

min-max-heap: a double-ended priority queue

Build Status Crates.io License: MIT License: Apache 2.0

A min-max-heap is like a binary heap, but it allows extracting both the minimum and maximum value efficiently. In particular, finding either the minimum or maximum element is worst-case O(1) time. A removal of either extreme, or an insertion, is worst-case O(log n) time.

Usage

It’s on crates.io, so add this to your Cargo.toml:

[dependencies]
min-max-heap = "1.3.0"

This crate supports Rust version 1.46 and later.

References

Contributors

tov

111 commits

nikic

3 commits

apendleton

2 commits

tov/min-max-heap-rs

A double-ended priority queue

Rust

43

127 commits

updated Jan 28, 2025

See the code

README

min-max-heap: a double-ended priority queue

Build Status Crates.io License: MIT License: Apache 2.0

A min-max-heap is like a binary heap, but it allows extracting both the minimum and maximum value efficiently. In particular, finding either the minimum or maximum element is worst-case O(1) time. A removal of either extreme, or an insertion, is worst-case O(log n) time.

Usage

It’s on crates.io, so add this to your Cargo.toml:

[dependencies]
min-max-heap = "1.3.0"

This crate supports Rust version 1.46 and later.

References

Contributors

tov

111 commits

nikic

3 commits

apendleton

2 commits

Languages

Rust

100.0%