pub struct PriorityQ { /* private fields */ }Expand description
The combined priority queue (sort-array + heap).
Implementations§
Source§impl PriorityQ
impl PriorityQ
pub fn new(size: usize, leq: fn(u32, u32) -> bool) -> Self
Sourcepub fn init(&mut self) -> bool
pub fn init(&mut self) -> bool
Initialize the sort-array phase. Must be called before extract_min/minimum/delete (but after all pre-init inserts).
Sourcepub fn insert(&mut self, key: u32) -> i32
pub fn insert(&mut self, key: u32) -> i32
Insert a key. Returns a handle. Negative handles are for the sort-array; non-negative for the heap.
Sourcepub fn extract_min(&mut self) -> u32
pub fn extract_min(&mut self) -> u32
Extract the minimum key.
Auto Trait Implementations§
impl Freeze for PriorityQ
impl RefUnwindSafe for PriorityQ
impl Send for PriorityQ
impl Sync for PriorityQ
impl Unpin for PriorityQ
impl UnsafeUnpin for PriorityQ
impl UnwindSafe for PriorityQ
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more