Document time of back operations of a Linked List

Popping and pushing from the end of a linked list is constant time. This
documentation is already there for popping and pushing from the front.

@bors: r+ 38fe8d2 rollup
This commit is contained in:
Chris Couzens
2018-12-10 12:43:15 +00:00
parent 9567a1cf59
commit 562f33b1a5
+5 -1
View File
@@ -627,7 +627,9 @@ pub fn pop_front(&mut self) -> Option<T> {
self.pop_front_node().map(Node::into_element)
}
/// Appends an element to the back of a list
/// Appends an element to the back of a list.
///
/// This operation should compute in O(1) time.
///
/// # Examples
///
@@ -647,6 +649,8 @@ pub fn push_back(&mut self, elt: T) {
/// Removes the last element from a list and returns it, or `None` if
/// it is empty.
///
/// This operation should compute in O(1) time.
///
/// # Examples
///
/// ```