How to get the closest item to my key from a SortedDictionary?

Viewed 3728

Currently I'm using a binary search over a SortedList<T,U> for a specific number, and if it doesn't exist I get the closest lower-bound key-item instead.

I saw that it was rather slow in inserting unsorted data which I'm doing a lot of.

Is there a way to do something similar with the SortedDictionary, or should I just stick to my SortedList?

1 Answers
Related