126
theirrightendpoints,sothatthefinalrepresentationofaninterval(x,y)intheprioritiy
searchtreeisatuple(Y,x),whereY = (y, x, ID).
6.7 Puttingitalltogether
Nowwewillexaminesomeofthealgorithmsfortheoperationslistedatthebeginningof
thissection.Inthepseudo-codeinthissection,theauxiliarydatastructuresareused,but
notdescribedinfulltokeepthefocusonthedetailsofwhatmustbeupdatedandqueried
when.Specializedstructuredforaddresscomparisonandmaintenanceoftheinsertionseg-
mentindexaredescribedinfull.
6.7.1 Addresscomparison
Wheneverachangeisaddedtothedatabase,theaddressesitcontainstoarestoredand
givenintegerlabels.Theselabelsareupdatedasnewaddressesareaddedtothedatabaseby
oneoftherenumberingalgorithmsgivenin(DietzandSleator1987),anddiscussedabove.
Palimpsestaddresscomparisoniscomplexandtheintegerlabelsservethefunctionofena-
blingconstant-timecomparisonofmanyaddresses,savingtimeonacommonoperation.
Addresseswithinmoveandcopydestinationsmayhavelongpaths.Inthedefinitionof
theorderingforPalimpsestaddresses,orderingquestionsarefrequentlyresolvedbyreducing
themtoquestionsonaddresseswithshorterpaths.Thesearegenerallynotstoredorlabeled,
astheyarenotusuallyreferencedbyotheroperations.Onlythoseaddressesarestoredthat
correspondtotheendpointsofranges(fordelete,copyandmove),ordestinations(forall
operations).
Tofindthecorrectpositioninthegloballistofstoredaddresses,acomparisonoperation
isneeded.Figure6.5showsthebasicmethodforastoredaddresstocompareitselftoan
arbitraryaddress.Notethatthedestinationaddressesofanychangesmustalreadyhave
beenstored,andarethusdirectlycomparablebymeansoflabels.Thefollowingauxiliary
methodsareusedinthecomparisonalgorithm:
theirrightendpoints,sothatthefinalrepresentationofaninterval(x,y)intheprioritiy
searchtreeisatuple(Y,x),whereY = (y, x, ID).
6.7 Puttingitalltogether
Nowwewillexaminesomeofthealgorithmsfortheoperationslistedatthebeginningof
thissection.Inthepseudo-codeinthissection,theauxiliarydatastructuresareused,but
notdescribedinfulltokeepthefocusonthedetailsofwhatmustbeupdatedandqueried
when.Specializedstructuredforaddresscomparisonandmaintenanceoftheinsertionseg-
mentindexaredescribedinfull.
6.7.1 Addresscomparison
Wheneverachangeisaddedtothedatabase,theaddressesitcontainstoarestoredand
givenintegerlabels.Theselabelsareupdatedasnewaddressesareaddedtothedatabaseby
oneoftherenumberingalgorithmsgivenin(DietzandSleator1987),anddiscussedabove.
Palimpsestaddresscomparisoniscomplexandtheintegerlabelsservethefunctionofena-
blingconstant-timecomparisonofmanyaddresses,savingtimeonacommonoperation.
Addresseswithinmoveandcopydestinationsmayhavelongpaths.Inthedefinitionof
theorderingforPalimpsestaddresses,orderingquestionsarefrequentlyresolvedbyreducing
themtoquestionsonaddresseswithshorterpaths.Thesearegenerallynotstoredorlabeled,
astheyarenotusuallyreferencedbyotheroperations.Onlythoseaddressesarestoredthat
correspondtotheendpointsofranges(fordelete,copyandmove),ordestinations(forall
operations).
Tofindthecorrectpositioninthegloballistofstoredaddresses,acomparisonoperation
isneeded.Figure6.5showsthebasicmethodforastoredaddresstocompareitselftoan
arbitraryaddress.Notethatthedestinationaddressesofanychangesmustalreadyhave
beenstored,andarethusdirectlycomparablebymeansoflabels.Thefollowingauxiliary
methodsareusedinthecomparisonalgorithm: