deque and randomized queue were implemented