pub trait BinaryHeap: VecLike {
    // Required methods
    fn heap_pop<Ctx>(&mut self, ctx: Ctx) -> Option<Self::Element>
       where Ctx: BinaryHeapCtx<Self::Element>;
    fn heap_remove<Ctx>(&mut self, i: usize, ctx: Ctx) -> Option<Self::Element>
       where Ctx: BinaryHeapCtx<Self::Element>;
    fn heap_push<Ctx>(&mut self, item: Self::Element, ctx: Ctx) -> usize
       where Ctx: BinaryHeapCtx<Self::Element>;
}
Expand description

Min-heap.

Required Methods§

source

fn heap_pop<Ctx>(&mut self, ctx: Ctx) -> Option<Self::Element>where Ctx: BinaryHeapCtx<Self::Element>,

Remove the least item from the heap and return it.

source

fn heap_remove<Ctx>(&mut self, i: usize, ctx: Ctx) -> Option<Self::Element>where Ctx: BinaryHeapCtx<Self::Element>,

Remove the item at the specified position and return it.

source

fn heap_push<Ctx>(&mut self, item: Self::Element, ctx: Ctx) -> usizewhere Ctx: BinaryHeapCtx<Self::Element>,

Push an item onto the heap and return its position.

Implementors§

source§

impl<T> BinaryHeap for Twhere T: VecLike,