returns a randomly chosen item from the queue without removing it . throws nosuchelementexception when queue is empty . concode_field_sep int current concode_elem_sep Item[] data concode_elem_sep Random randomGenerator concode_elem_sep Item[] items concode_elem_sep int N concode_field_sep Item next concode_elem_sep void enqueue concode_elem_sep Iterator<Item> iterator concode_elem_sep int size concode_elem_sep Item dequeue concode_elem_sep boolean isEmpty concode_elem_sep void resize concode_elem_sep boolean hasNext concode_elem_sep void remove
Item function ( ) { if ( isEmpty ( ) ) throw new NoSuchElementException ( "srini_string" ) ; int loc0 = randomGenerator . nextInt ( N ) ; Item loc1 = items [ loc0 ] ; return loc1 ; }