-
deque is dynamically doublely linked list, it has the following benefits comparing with list: O(1) pop() O(1) popleft()
-
on the other hand, list has O(1) random access, better for fixed size and random access.
-
deque is mostly used for sliding window max implementation