Struct adivon::priority_queue::binary_heaps::MaxPQ
[−]
[src]
pub struct MaxPQ<Key> { /* fields omitted */ }
Generic max priority queue implementation with a binary heap
Methods
impl<Key: PartialOrd> MaxPQ<Key>
[src]
fn new() -> Self
create an empty priority queue
fn from_vec(a: Vec<Key>) -> Self
create a priority queue with given keys
fn insert(&mut self, x: Key)
insert a key into the priority queue
fn del_max(&mut self) -> Option<Key>
return and remove the largest key
fn is_empty(&self) -> bool
is the priority queue empty?
fn max(&self) -> Option<&Key>
return the largest key
fn size(&self) -> usize
number of entries in the priority queue