deque and randomized queue data structure.