class documentation

class LinkedDeque(_DoublyLinkedBase):

View In Hierarchy

Double-ended queue implementation based on a doubly linked list.

Method delete_first Remove and return the element from the front of the deque.
Method delete_last Remove and return the element from the back of the deque.
Method first Return (but do not remove) the element at the front of the deque.
Method insert_first Add an element to the front of the deque.
Method insert_last Add an element to the back of the deque.
Method last Return (but do not remove) the element at the back of the deque.

Inherited from _DoublyLinkedBase:

Method __init__ Create an empty list.
Method __len__ Return the number of elements in the list.
Method is_empty Return True if list is empty.
Class _Node Lightweight, nonpublic class for storing a doubly linked node.
Method _delete_node Delete nonsentinel node from the list and return its element.
Method _insert_between Add element e between two existing nodes and return new node.
Instance Variable _header Undocumented
Instance Variable _size Undocumented
Instance Variable _trailer Undocumented
def delete_first(self):

Remove and return the element from the front of the deque.

Raise Empty exception if the deque is empty.

def delete_last(self):

Remove and return the element from the back of the deque.

Raise Empty exception if the deque is empty.

def first(self):

Return (but do not remove) the element at the front of the deque.

Raise Empty exception if the deque is empty.

def insert_first(self, e):

Add an element to the front of the deque.

def insert_last(self, e):

Add an element to the back of the deque.

def last(self):

Return (but do not remove) the element at the back of the deque.

Raise Empty exception if the deque is empty.