Fast always automatic sorted list, in C#?

  • Thread starter Thread starter Olaf Baeyens
  • Start date Start date
O

Olaf Baeyens

I have to load about 10000 possible file names into a list and must have
thems sorted alphabetically, including the file information.
At this moment, in conventional C++, I use a sorted file strng list with a
binary search to add the file name at the correct location, this way it is
very fast. I but I created my own string list.

So here is my question: Does C# or the .NET framework have such a sorted
list that I can add the items during the load phase at the correct position
so that it is always automatically sorted? I don't want to reinvent the
wheel.

Thanks. :-)
 
I'd used HashTables. Items are indexed by the values they contain. Very
Wow, a super fast reply. :-)
I am checking into this, it seems interesting, but I must have it in sorted
order because I have sequence numbers in the file names, and I must be able
to determin if some of them are missing without having to try all possible
combinations.

It is a sequence of bitmaps representing a data-set or maybe a movie. So the
order of putting the images together is important.

Thanks for the tip! :-)
 
In light of the info you provided, SortedList is the way to go, but beware
the length limits on key string fields. I was having problems yesterday with
this actually, and had to change to a StringDictionary (whihc probably
wouldn't suit your needs).

Later.
Dan
 
Back
Top