adaptable priority queues the methods of the priority queue adt given in section are sufficient for most basic applications of priority queuessuch as sorting howeverthere are situations in which additional methods would be usefulas shown by the scenarios below involving the standby airline passenger application standby passenger with pessimistic attitude may become tired of waiting and decide to leave ahead of the boarding timerequesting to be removed from the waiting list thuswe would like to remove from the priority queue the entry associated with this passenger operation remove min does not suffice since the passenger leaving does not necessarily have first priority insteadwe want new operationremovethat removes an arbitrary entry another standby passenger finds her gold frequent-flyer card and shows it to the agent thusher priority has to be modified accordingly to achieve this change of prioritywe would like to have new operation update allowing us to replace the key of an existing entry with new key we will see another application of adaptable priority queues when implementing certain graph algorithms in sections and in this sectionwe develop an adaptable priority queue adt and demonstrate how to implement this abstraction as an extension to our heap-based priority queue locators in order to implement methods update and remove efficientlywe need mechanism for finding user' element within priority queue that avoids performing linear search through the entire collection to support our goalwhen new element is added to the priority queuewe return special object known as locator to the caller we then require the user to provide an appropriate locator as parameter when invoking the update or remove methodas followsfor priority queue pp update(lockv)replace key and value for the item identified by locator loc remove(loc)remove the item identified by locator loc from the priority queue and return its (key,valuepair the locator abstraction is somewhat akin to the position abstraction used in our positional list adt from section and our tree adt from howeverwe differentiate between locator and position because locator for priority queue does not represent tangible placement of an element within the structure in our priority queuean element may be relocated within our data structure during an operation that does not seem directly relevant to that element locator for an item will remain validas long as that item remains somewhere in the queue