3
3
//! Insertion and popping the largest element have *O*(log(*n*)) time complexity.
4
4
//! Checking the largest element is *O*(1). Converting a vector to a binary heap
5
5
//! can be done in-place, and has *O*(*n*) complexity. A binary heap can also be
6
- //! converted to a sorted vector in-place, allowing it to be used for an *O*(*n* \ * log(*n*))
6
+ //! converted to a sorted vector in-place, allowing it to be used for an *O*(*n* * log(*n*))
7
7
//! in-place heapsort.
8
8
//!
9
9
//! # Examples
@@ -159,9 +159,9 @@ use super::SpecExtend;
159
159
/// This will be a max-heap.
160
160
///
161
161
/// It is a logic error for an item to be modified in such a way that the
162
- /// item's ordering relative to any other item, as determined by the `Ord`
162
+ /// item's ordering relative to any other item, as determined by the [ `Ord`]
163
163
/// trait, changes while it is in the heap. This is normally only possible
164
- /// through `Cell`, `RefCell`, global state, I/O, or unsafe code. The
164
+ /// through [ `Cell`], [ `RefCell`] , global state, I/O, or unsafe code. The
165
165
/// behavior resulting from such a logic error is not specified, but will
166
166
/// not result in undefined behavior. This could include panics, incorrect
167
167
/// results, aborts, memory leaks, and non-termination.
@@ -219,7 +219,7 @@ use super::SpecExtend;
219
219
///
220
220
/// ## Min-heap
221
221
///
222
- /// Either `std ::cmp::Reverse` or a custom `Ord` implementation can be used to
222
+ /// Either [`core ::cmp::Reverse`] or a custom [ `Ord`] implementation can be used to
223
223
/// make `BinaryHeap` a min-heap. This makes `heap.pop()` return the smallest
224
224
/// value instead of the greatest one.
225
225
///
@@ -243,13 +243,17 @@ use super::SpecExtend;
243
243
///
244
244
/// # Time complexity
245
245
///
246
- /// | [push] | [pop] | [peek]/[peek\_mut] |
247
- /// |--------| -----------|--------------------|
248
- /// | O (1)~ | *O*(log(*n*)) | *O*(1) |
246
+ /// | [push] | [pop] | [peek]/[peek\_mut] |
247
+ /// |---------|---- -----------|--------------------|
248
+ /// | *O* (1)~ | *O*(log(*n*)) | *O*(1) |
249
249
///
250
250
/// The value for `push` is an expected cost; the method documentation gives a
251
251
/// more detailed analysis.
252
252
///
253
+ /// [`core::cmp::Reverse`]: core::cmp::Reverse
254
+ /// [`Ord`]: core::cmp::Ord
255
+ /// [`Cell`]: core::cell::Cell
256
+ /// [`RefCell`]: core::cell::RefCell
253
257
/// [push]: BinaryHeap::push
254
258
/// [pop]: BinaryHeap::pop
255
259
/// [peek]: BinaryHeap::peek
@@ -1255,9 +1259,10 @@ impl<T> FusedIterator for Iter<'_, T> {}
1255
1259
/// An owning iterator over the elements of a `BinaryHeap`.
1256
1260
///
1257
1261
/// This `struct` is created by [`BinaryHeap::into_iter()`]
1258
- /// (provided by the `IntoIterator` trait). See its documentation for more.
1262
+ /// (provided by the [ `IntoIterator`] trait). See its documentation for more.
1259
1263
///
1260
1264
/// [`into_iter`]: BinaryHeap::into_iter
1265
+ /// [`IntoIterator`]: core::iter::IntoIterator
1261
1266
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1262
1267
#[ derive( Clone ) ]
1263
1268
pub struct IntoIter < T > {
0 commit comments