the minimum-key item is always at the top (highest indexin the arrayand the largest item is always at index figure shows the arrangement when the applet is started initiallythere are five items in the queue figure the priorityq workshop applet the insert button try inserting an item you'll be prompted to type the new item' key value into the number field choose number that will be inserted somewhere in the middle of the values already in the queue for examplein figure you might choose thenas you repeatedly press insyou'll see that the items with smaller keys are shifted up to make room black arrow shows which item is being shifted when the appropriate position is foundthe new item is inserted into the newly created space notice that there' no wraparound in this implementation of the priority queue insertion is slow of necessity because the proper in-order position must be foundbut deletion is fast wraparound implementation wouldn' improve the situation note too that the rear arrow never movesit always points to index at the bottom of the array the delete button the item to be removed is always at the top of the arrayso removal is quick and easythe item is removed and the front arrow moves down to point to the new top of the array no shifting or comparisons are necessary in the priorityq workshop appletwe show front and rear arrows to provide comparison with an ordinary queuebut they're not really necessary the algorithms