Trait r3_kernel::utils::binary_heap::BinaryHeap
source · 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§
sourcefn heap_pop<Ctx>(&mut self, ctx: Ctx) -> Option<Self::Element>where
Ctx: BinaryHeapCtx<Self::Element>,
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.
sourcefn heap_remove<Ctx>(&mut self, i: usize, 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>,
Remove the item at the specified position and return it.