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:
parent
9567a1cf59
commit
562f33b1a5
1 changed files with 5 additions and 1 deletions
|
|
@ -627,7 +627,9 @@ impl<T> LinkedList<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 @@ impl<T> LinkedList<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
|
||||
///
|
||||
/// ```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue