Writes a generic data type for a deque and a randomized queue. A double-ended queue or deque (pronounced "deck") is a generalization of a stack and a queue that supports adding and removing items from either the front or the back of the data structure. A randomized queue is similar to a stack or queue, except that the item removed is chosen uniformly at random from items in the data structure.