Skip to content

Commit

Permalink
Fix time complexity in BinaryHeap::peek_mut docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SkiFire13 committed Sep 19, 2020
1 parent af1e363 commit ca15e9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/alloc/src/collections/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) }
Expand Down

0 comments on commit ca15e9d

Please sign in to comment.