heapp 0.1.0

Some heap operations on slice
Documentation
  • Coverage
  • 100%
    8 out of 8 items documented0 out of 7 items with examples
  • Size
  • Source code size: 40.24 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 673.12 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Jamyw7g/heapp
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Jamyw7g

heapp

Some heap operations on slice

Example

The following examples show a quick example of some of the very basic functionality of heapp.

use heapp::*;

fn main() {
  let mut heap = vec![4, 7, 8, 3, 4, 90, 78, 67, 90];
  heapify(&mut heap);	// build a heap
  heap.push(32);
  heap_push(&mut heap); // push an element into the heap
  heap_pop(&mut heap); // pop an element from the heap
  let ele = heap.pop().unwrap();
  
  heap_sort(&mut heap); // same as heap.sort(), but using heap sort algorithm
  
  let res = n_smallest(&mut heap, 3); // res == [3, 4, 4]
}