last(getvalue(get(lastkey()successors(ktailmap(kentryset(iterator(predecessors(kheadmap(kentryset(iterator(flight databases and maxima sets as we have mentioned in the preceding sectionsunordered and ordered dictionaries have many applications in this sectionwe explore some specific applications of ordered dictionaries flight databases there are several web sites on the internet that allow users to perform queries on flight databases to find flights between various citiestypically with the intent to buy ticket to make querya user specifies origin and destination citiesa departure dateand departure time to support such querieswe can model the flight database as dictionarywhere keys are flight objects that contain fields corresponding to these four parameters that isa key is tuple (origindestinationdatetimeadditional information about flightsuch as the flight numberthe number of seats still available in first (fand coach (yclassthe flight durationand the farecan be stored in the value object finding requested flight is not simply matter of finding key in the dictionary matching the requested queryhowever the main difficulty is thatalthough user typically wants to exactly match the origin and destination citiesas well as the departure datehe or she will probably be content with any departure time that is close to his or her requested departure time we can handle such queryof courseby ordering our keys lexicographically thusgiven user query key kwe can call successors(kto return an iteration of all the flights between the desired cities on the desired datewith departure times in strictly increasing order from the requested departure time similar use of predecessors(kwould give us flights with times before the requested time thereforean efficient