implementing an adaptable priority queue exercises java datastructures net the priority queue abstract data type priority queue is an abstract data type for storing collection of prioritized elements that supports arbitrary element insertion but supports removal of elements in order of prioritythat isthe element with first priority can be removed at any time this adt is fundamentally different from the position-based data structures we discussed in previous such as stacksqueuesdequeslistsand even trees these other data structures store elements at specific positionswhich are often positions in linear arrangement of the elements determined by the insertion and deletion operations performed the priority queue adt stores elements according to their prioritiesand exposes no notion of "positionto the user keysprioritiesand total order relations applications commonly require that we compare objects according to parameters or propertiescalled "keys,that are assigned for each object in collection formallywe define key to be an object that is assigned to an element as specific attribute for that elementwhich can be used to identify or weigh that element note that the key is assigned to an elementtypically by user or applicationhencea key might represent property that an element did not originally possess the key an application assigns to an element is not necessarily uniquehoweverand an application may even change an element' key if it needs to for examplewe can compare companies by earnings or by number of employeeshenceeither of these parameters can be used as key for companydepending on the information we wish to extract likewisewe can compare restaurants by critic' food quality rating or by average entree price to achieve the most generality thenwe allow key to be of any type that is appropriate for particular application