Implementing RandomizedQueue