generic data type for a deque and a randomized queue