Fix time complexity in BinaryHeap::peek_mut docs
This commit is contained in:
parent
af1e3633f7
commit
ca15e9d8a1
|
@ -399,7 +399,8 @@ impl<T: Ord> BinaryHeap<T> {
|
|||
///
|
||||
/// # Time complexity
|
||||
///
|
||||
/// Cost is *O*(1) in the worst case.
|
||||
/// If the item is modified then the worst case time complexity is *O*(log(*n*)),
|
||||
/// otherwise it's *O*(1).
|
||||
#[stable(feature = "binary_heap_peek_mut", since = "1.12.0")]
|
||||
pub fn peek_mut(&mut self) -> Option<PeekMut<'_, T>> {
|
||||
if self.is_empty() { None } else { Some(PeekMut { heap: self, sift: false }) }
|
||||
|
|
Loading…
Reference in New Issue