about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTakashi Idobe <idobetakashi@gmail.com>2021-09-23 17:58:02 -0500
committerGitHub <noreply@github.com>2021-09-23 17:58:02 -0500
commitd63e0f0e477654cb39036eb6f8b45e2dd6f4d371 (patch)
tree58339ee15f9d57f4e0f574b6fdf9cf60f6c1f7eb
parent2b862bed9889808b69629fd7246317189b9517a5 (diff)
downloadrust-d63e0f0e477654cb39036eb6f8b45e2dd6f4d371.tar.gz
rust-d63e0f0e477654cb39036eb6f8b45e2dd6f4d371.zip
Add time complexities to linked_list.rs
-rw-r--r--library/alloc/src/collections/linked_list.rs10
1 files changed, 10 insertions, 0 deletions
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<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
     ///
     /// ```
@@ -655,6 +657,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
     ///
@@ -675,6 +679,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
     ///
@@ -701,6 +707,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
     ///
@@ -721,6 +729,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
     ///