| Crates.io | nostbeep |
| lib.rs | nostbeep |
| version | 0.1.1 |
| created_at | 2022-10-14 12:01:14.332328+00 |
| updated_at | 2022-10-14 21:01:19.904181+00 |
| description | A no_std implementation of a binary heap. Binary Heap is implemented as a max heap. |
| homepage | |
| repository | https://github.com/luke-lorenzini/binary-heap/ |
| max_upload_size | |
| id | 688161 |
| size | 6,867 |
A no_std implementation of a binary heap. More specifically, a max heap.
use nostbeep::MaxHeap;
let val1 = 17;
let val2 = -5;
let val3 = 100;
let mut my_heap = MaxHeap::new();
assert_eq!(0, my_heap.len());
my_heap.push(val1);
my_heap.push(val2);
my_heap.push(val3);
my_heap.pop();
my_heap.pop();
assert_eq!(Some(val2), my_heap.pop());