Implement a double-ended queue or deque.