Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions library/alloc/src/collections/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,10 @@ impl<T: Ord> BinaryHeap<T> {
/// let vec = heap.into_sorted_vec();
/// assert_eq!(vec, [1, 2, 3, 4, 5, 6, 7]);
/// ```
///
/// # Time complexity
///
/// The time complexity of `into_sorted_vec` on a heap containing `n` items is *O*(*n*log(*n*)).
#[stable(feature = "binary_heap_extras_15", since = "1.5.0")]
pub fn into_sorted_vec(mut self) -> Vec<T> {
let mut end = self.len();
Expand Down
10 changes: 10 additions & 0 deletions library/alloc/src/collections/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,8 @@ impl<T> LinkedList<T> {
/// Returns `true` if the `LinkedList` contains an element equal to the
/// given value.
///
/// This operation should compute in *O*(*n*) time.
///
/// # Examples
///
/// ```
Expand All @@ -656,6 +658,8 @@ impl<T> LinkedList<T> {
/// Provides a reference to the front element, or `None` if the list is
/// empty.
///
/// This operation should compute in *O*(1) time.
///
/// # Examples
///
/// ```
Expand All @@ -676,6 +680,8 @@ impl<T> LinkedList<T> {
/// Provides a mutable reference to the front element, or `None` if the list
/// is empty.
///
/// This operation should compute in *O*(1) time.
///
/// # Examples
///
/// ```
Expand All @@ -702,6 +708,8 @@ impl<T> LinkedList<T> {
/// Provides a reference to the back element, or `None` if the list is
/// empty.
///
/// This operation should compute in *O*(1) time.
///
/// # Examples
///
/// ```
Expand All @@ -722,6 +730,8 @@ impl<T> LinkedList<T> {
/// Provides a mutable reference to the back element, or `None` if the list
/// is empty.
///
/// This operation should compute in *O*(1) time.
///
/// # Examples
///
/// ```
Expand Down