dumb question?

  • Thread starter Thread starter PJ6
  • Start date Start date
P

PJ6

I have a Collections.Generic.Dictionary(Of Integer, Integer). I want to sort
its contents based on the keys.

Right now the only way I can think of doing this is manually creating a
KeyValuePair array from its contents, sorting it, and then clearing out the
contents and adding them all back in order.

Should I use SortedList instead? Or would that be worse for performance
since it re-sorts on every item add?

Paul
 
Should I use SortedList instead? Or would that be worse for performance
since it re-sorts on every item add?

What results did your perf testing produce when you compared them?

Bob Lehmann
 
I have a Collections.Generic.Dictionary(Of Integer, Integer). I want to sort
its contents based on the keys.

Have you considered the SortedDictionary(Of TKey, TValue) class?


Mattias
 
Back
Top