| Crates.io | heapify |
| lib.rs | heapify |
| version | 0.2.0 |
| created_at | 2022-08-09 10:32:46.568661+00 |
| updated_at | 2022-08-11 10:38:42.498099+00 |
| description | Convenience functions to turn slices into max-heaps. |
| homepage | |
| repository | https://github.com/ethereal-sheep/heapify |
| max_upload_size | |
| id | 641714 |
| size | 36,533 |
A collection of convenience functions for heapifying a slice in rust.
A simple way to use heapify is with a Vec<T>.
use heapify::*;
let mut vec = vec![5, 7, 9];
make_heap(&mut vec);
pop_heap(&mut vec);
assert_eq!(vec.pop(), Some(9));
pop_heap(&mut vec);
assert_eq!(vec.pop(), Some(7));
assert_eq!(peek_heap(&mut vec), Some(&5));
cargo install heapifyLicensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
See CONTRIBUTING.md.