pub struct FibHeap<K> { /* private fields */ }Expand description
Same interface as MinHeap, backed by a Fibonacci heap.
Implementations§
Source§impl<K: PartialOrd + Copy> FibHeap<K>
impl<K: PartialOrd + Copy> FibHeap<K>
pub fn new() -> Self
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn clear(&mut self)
pub fn build_heap(items: Vec<(usize, K)>) -> Self
pub fn insert(&mut self, item: (usize, K))
pub fn get_min(&self) -> Option<&(usize, K)>
pub fn delete_min(&mut self) -> Option<(usize, K)>
pub fn decrease_key(&mut self, id: usize, new_key: K)
Auto Trait Implementations§
impl<K> Freeze for FibHeap<K>
impl<K> RefUnwindSafe for FibHeap<K>where
K: RefUnwindSafe,
impl<K> Send for FibHeap<K>where
K: Send,
impl<K> Sync for FibHeap<K>where
K: Sync,
impl<K> Unpin for FibHeap<K>where
K: Unpin,
impl<K> UnwindSafe for FibHeap<K>where
K: UnwindSafe,
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