.NET SortedDictionary But Sorted By Values
- by Michael Covelli
I need a data structure that acts like a SortedDictionary<int, double> but is sorted based on the values rather than the keys. I need it to take about 1-2 microseconds to add and remove items when we have about 3000 items in the dictionary.
My first thought was simply to switch the keys and values in my code. This very nearly works. I can…