min-max-heap

Crates.iomin-max-heap
lib.rsmin-max-heap
version1.3.0
sourcesrc
created_at2016-06-13 00:25:49.578265
updated_at2019-12-30 02:23:47.468996
descriptionAn efficient, double-ended priority queue
homepage
repositoryhttps://github.com/tov/min-max-heap-rs
max_upload_size
id5365
size58,276
Jesse A. Tov (tov)

documentation

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 O(1). A removal of either extremum, or an insertion, is O(log n).

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.32.0 and later.

References

My reference for a min-max heap is here. Much of this code is also based on BinaryHeap from the standard library.

Commit count: 127

cargo fmt