Struct comp_sci::data_structures::binary_heap::BinaryHeap [-]  [+] [src]

pub struct BinaryHeap<A: Ord> {
    // some fields omitted
}

An implementation of a binary heap.

This is a max-heap implementation.

Methods

impl<A: Ord> BinaryHeap<A>

fn new() -> BinaryHeap<A>

fn push(&mut self, element: A)

Pushes a new element into the heap.

fn pop(&mut self) -> Option<A>

Pops out the most important element.

fn length(&self) -> usize

Returns the length of this heap.