4 ms·
Hmmm, does an ordered dictionary actually solve this problem? It seems like you want to retrieve based on player id, but get the top N based on score. An ordere
by lacker 18y ago
Hmmm, does an ordered dictionary actually solve this problem? It seems like you want to retrieve based on player id, but get the top N based on score. An ordered dictionary would be ideal if you wanted to retrieve and get the top N based on the same key.
I guess you could use two data structures, with one of them being an ordered dictionary. But then the ordered dictionary doesn't actually have to support lookup; you could just use a heap.