From d63e0f0e477654cb39036eb6f8b45e2dd6f4d371 Mon Sep 17 00:00:00 2001 From: Takashi Idobe Date: Thu, 23 Sep 2021 17:58:02 -0500 Subject: Add time complexities to linked_list.rs --- library/alloc/src/collections/linked_list.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'library/alloc') diff --git a/library/alloc/src/collections/linked_list.rs b/library/alloc/src/collections/linked_list.rs index 9d45c5082db..e98b3270336 100644 --- a/library/alloc/src/collections/linked_list.rs +++ b/library/alloc/src/collections/linked_list.rs @@ -631,6 +631,8 @@ impl LinkedList { /// Returns `true` if the `LinkedList` contains an element equal to the /// given value. /// + /// This operation should compute in *O*(*n*) time. + /// /// # Examples /// /// ``` @@ -655,6 +657,8 @@ impl LinkedList { /// Provides a reference to the front element, or `None` if the list is /// empty. + /// + /// This operation should compute in *O*(*1*) time. /// /// # Examples /// @@ -675,6 +679,8 @@ impl LinkedList { /// Provides a mutable reference to the front element, or `None` if the list /// is empty. + /// + /// This operation should compute in *O*(*1*) time. /// /// # Examples /// @@ -701,6 +707,8 @@ impl LinkedList { /// Provides a reference to the back element, or `None` if the list is /// empty. + /// + /// This operation should compute in *O*(*1*) time. /// /// # Examples /// @@ -721,6 +729,8 @@ impl LinkedList { /// Provides a mutable reference to the back element, or `None` if the list /// is empty. + /// + /// This operation should compute in *O*(*1*) time. /// /// # Examples /// -- cgit 1.4.1-3-g733a5