more than single numerical valuesuch as pricelengthweightor speed that isa key can sometimes be more complex property that cannot be quantified with single number for examplethe priority of standby passengers is usually determined by taking into account host of different factorsincluding frequentflyer statusthe fare paidand check-in time in some applicationsthe key for an object is part of the object itself (for exampleit might be an instance variable storing the list price of bookor the weight of carin other applicationsthe key is not part of the object but the object gets assigned its key by the application (for examplethe quality rating given to stock by financial analystor the priority assigned to standby passenger by gate agentcomparing keys with total orders priority queue needs comparison rule that will never contradict itself in order for comparison rulewhich we denote by <=to be robust in this wayit must define total order relationwhich is to say that the comparison rule is defined for every pair of keys and it must satisfy the following propertiesreflexive propertyk < antisymmetric propertyif < and < then transitive propertyif < and < then < any comparison rule<=that satisfies these three properties will never lead to comparison contradiction in factsuch rule defines linear ordering relationship among set of keyshenceif (finitecollection of elements has total order defined for itthen the notion of smallest keyk min is well definedas key in which min <kfor any other key in our collection priority queue is collection of elementscalled valueseach having an associated key that is provided at the time the element is inserted key-value pair inserted into priority queue is called an entry of the priority queue the name "priority queuecomes from the fact that keys determine the "priorityused to pick entries to be removed the two fundamental methods of priority queue are as followsinsert( , )insert value with key into removemin()return and remove from an entry with the smallest keythat isan entry whose key is less than or equal to that of every other entry in by the waysome people refer to the removemin method as the "extractminmethodso as to stress that this method simultaneously removes and returns an entry there are many applications where the insert and