
15 Jul
2011
15 Jul
'11
6:13 a.m.
On Fri, Jul 15, 2011 at 11:42 AM, Kees Bleijenberg
My program uses a very long list of (index,count) items. Index and count are Int's. The program updates the count values a lot. Therefor it uses the index as a key to update the belonging count value. After updating, the program needs the (index,count) pair with the least count value in the list. What is an approriate (fast) datastructure? My first idea was to use a heap. Problem with the heap is that I can't update the count value by its index fast. Any ideas?
Do you need to be able to "remove" the pair that has the least count cheaply ? -- Jedaï