impl randomizedQueue.java (NG)