implementing an adaptable priority queue in this sectionwe provide python implementation of an adaptable priority queue as an extension of our heappriorityqueue class from section to implement locator classwe will extend the existing item composite to add an additional field designating the current index of the element within the array-based representation of our heapas shown in figure token ( , , ( , , ( , , ( , , ( , , ( , , ( , , ( , , figure representing heap using sequence of locators the third element of each locator instance corresponds to the index of the item within the array identifier token is presumed to be locator reference in the user' scope the list is sequence of references to locator instanceseach of which stores keyvalueand the current index of the item within the list the user will be given reference to the locator instance for each inserted elementas portrayed by the token identifier in figure when we perform priority queue operations on our heapand items are relocated within our structurewe reposition the locator instances within the list and we update the third field of each locator to reflect its new index within the list as an examplefigure shows the state of the above heap after call to remove minthe heap operation caused the minimum entry( , )to be removedand the entry( , )to be temporarily moved from the last position to the rootfollowed by down-heap bubble phase during the down-heapelement ( ,xwas swapped token ( , , ( , , ( , , ( , , ( , , ( , , ( , , figure the result of call to remove minon the heap originally portrayed in figure identifier token continues to reference the same locator instance as in the original configurationbut the placement of that locator in the list has changedas has the third field of the locator