Looking for sorted collection classes that allows duplicate keys...

F

faustino Dina

Hi,

I need to store my data on a sorted collection, where the sorting key can be
duplicated. I've been looking around .NET collection classes but they
expects unique keys for sorting. What can I do? Is any other resource for
..NET collections on the web?

Thanks in advance
 
G

Greg Young

arraylist ? then just call sort() you can override the add if you need
autosorting
 
F

faustino Dina

arraylist ? then just call sort() you can override the add if you need
autosorting
I was not aware of that method. I was thinking on a hashtable, but really I
don't need autosorting, just sort once and iterate. I'll try this. Thanks

Faustino
 
G

Greg Young

A hashtable is a poor structure for sorting ... it is great for searching
though ...
 
F

faustino Dina

Then do you recommend an ArrayList, or better a simple Array? I suppose the
sort() function for these is implemented as a quicksort that is well suited
for use on arrays. Am I right?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top