the priority queue abstract data type priorities in we introduced the queue adt as collection of objects that are added and removed according to the first-infirst-out (fifoprinciple company' customer call center embodies such model in which waiting customers are told "calls will be answered in the order that they were received in that settinga new call is added to the back of the queueand each time customer service representative becomes availablehe or she is connected with the call that is removed from the front of the call queue in practicethere are many applications in which queue-like structure is used to manage objects that must be processed in some waybut for which the first-infirst-out policy does not suffice considerfor examplean air-traffic control center that has to decide which flight to clear for landing from among many approaching the airport this choice may be influenced by factors such as each plane' distance from the runwaytime spent waiting in holding patternor amount of remaining fuel it is unlikely that the landing decisions are based purely on fifo policy there are other situations in which "first comefirst servepolicy might seem reasonableyet for which other priorities come into play to use another airline analogysuppose certain flight is fully booked an hour prior to departure because of the possibility of cancellationsthe airline maintains queue of standby passengers hoping to get seat although the priority of standby passenger is influenced by the check-in time of that passengerother considerations include the fare paid and frequent-flyer status so it may be that an available seat is given to passenger who has arrived later than anotherif such passenger is assigned better priority by the airline agent in this we introduce new abstract data type known as priority queue this is collection of prioritized elements that allows arbitrary element insertionand allows the removal of the element that has first priority when an element is added to priority queuethe user designates its priority by providing an associated key the element with the minimum key will be the next to be removed from the queue (thusan element with key will be given priority over an element with key although it is quite common for priorities to be expressed numericallyany python object may be used as keyas long as the object type supports consistent meaning for the test bfor any instances and bso as to define natural order of the keys with such generalityapplications may develop their own notion of priority for each element for exampledifferent financial analysts may assign different ratings ( prioritiesto particular assetsuch as share of stock