vendredi 27 mars 2015

how to update locations in priority queue


here is my scenario and i want some smart solution for this problem.


i have 1024 locations, and each location is associated with a entry. now i have added 1024 location on top of already existing 1024 location. now i have to update the locations of already existing entries associated with the old 1024 locations. is there any smart way to do it without iterating through all the 1024 entries.


here is the scenario.



location 0 associated to ==> entry 0
location 1 associated to ==> entry 1
location 2 associated to ==> entry 2
location 3 associated to ==> entry 3
.
.
.
.
location 1023 associated to ==> entry 1023



now i have added new 1024 locations on top. so i have to update the locations of entries as follow

location 0 new location
location 1 new location
location 2 new location
location 3 new location
location 4 new location
.
.
.
.
location 1024 associated to ==> entry 0
location 1025 associated to ==> entry 1
location 1026 associated to ==> entry 2
location 1027 associated to ==> entry 3
location 1028 associated to ==> entry 4
.
.
.
location 2047 associated to ==> entry 1023


to do this is there any way to do this without looping through all the entries one by one and update the location?




Aucun commentaire:

Enregistrer un commentaire