Tutorial by Topics: deque

dq = deque() # Creates an empty deque dq = deque(iterable) # Creates a deque with some elements dq.append(object) # Adds object to the right of the deque dq.appendleft(object) # Adds object to the left of the deque dq.pop() -> object # Removes and returns the righ...
A Deque is linear collection that supports element insertion and removal at both ends. The name deque is short for "double ended queue" and is usually pronounced "deck". Most Deque implementations place no fixed limits on the number of elements they may contain, but this interf...

Page 1 of 1