[][src]Trait algorithms_edu::data_structures::priority_queue::PriorityQueue

pub trait PriorityQueue<T: PartialOrd> {
    pub fn with_capacity(sz: usize) -> Self;
pub fn insert(&mut self, el: T);
pub fn contains(&self, el: &T) -> bool;
pub fn remove(&mut self, el: &T);
pub fn poll(&mut self) -> Option<T>; }

Required methods

pub fn with_capacity(sz: usize) -> Self[src]

pub fn insert(&mut self, el: T)[src]

pub fn contains(&self, el: &T) -> bool[src]

pub fn remove(&mut self, el: &T)[src]

pub fn poll(&mut self) -> Option<T>[src]

Loading content...

Implementors

impl<T: PartialOrd> PriorityQueue<T> for BinaryHeap<T>[src]

pub fn insert(&mut self, el: T)[src]

Adds an element to the priority queue, O(log(n))

pub fn contains(&self, el: &T) -> bool[src]

Test if an element is in heap, O(n)

pub fn remove(&mut self, el: &T)[src]

Removes a particular element in the heap, O(n)

pub fn poll(&mut self) -> Option<T>[src]

Removes the root of the heap, O(log(n))

Loading content...