Does .net have a sorted collection component similar to the C++ std::set ? I
am not interested in a dictionary object, just a sorted collection where I
can pass in a delegate to do the sort. I am also not interested in calling
ArrayList's Sort() as I want the collection to automatically maintain its
sort order when objects are inserted into it.

I looked in the System.Collections and System.Collections.Specialized but
did not find a sorted collection class which was not also a dictionary.

Re: Sorted array component by Matt

Matt
Wed Jan 26 17:47:11 CST 2005

Hello Edward,

There is System.Collections.SortedList... The "delegate" you talk about would
be the implementation of the IComparable[1] interface on the objects you
are stuffing into that collection.

[1] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemicomparableclasstopic.asp

--
Matt Berther
http://www.mattberther.com

> Does .net have a sorted collection component similar to the C++
> std::set ? I am not interested in a dictionary object, just a sorted
> collection where I can pass in a delegate to do the sort. I am also
> not interested in calling ArrayList's Sort() as I want the collection
> to automatically maintain its sort order when objects are inserted
> into it.
>
> I looked in the System.Collections and System.Collections.Specialized
> but did not find a sorted collection class which was not also a
> dictionary.
>



Re: Sorted array component by Søren

Søren
Fri Jan 28 03:57:21 CST 2005

Hi

I've been using:

http://www.codeproject.com/csharp/sets.asp

Regards,

Søren



"Edward Diener" <diener_no_spam_ok@ORsoftware.com> wrote in message
news:Ot3TQp9AFHA.3264@TK2MSFTNGP12.phx.gbl...
> Does .net have a sorted collection component similar to the C++ std::set ?
> I am not interested in a dictionary object, just a sorted collection where
> I can pass in a delegate to do the sort. I am also not interested in
> calling ArrayList's Sort() as I want the collection to automatically
> maintain its sort order when objects are inserted into it.
>
> I looked in the System.Collections and System.Collections.Specialized but
> did not find a sorted collection class which was not also a dictionary.
>



Re: Sorted array component by saurabh

saurabh
Fri Jan 28 04:13:41 CST 2005

Do you mean SortedList ?

--Saurabh
"Søren M. Olesen" <smolesen@hotmail.com> wrote in message
news:uHkrL$RBFHA.2584@TK2MSFTNGP09.phx.gbl...
> Hi
>
> I've been using:
>
> http://www.codeproject.com/csharp/sets.asp
>
> Regards,
>
> Søren
>
>
>
> "Edward Diener" <diener_no_spam_ok@ORsoftware.com> wrote in message
> news:Ot3TQp9AFHA.3264@TK2MSFTNGP12.phx.gbl...
>> Does .net have a sorted collection component similar to the C++ std::set
>> ? I am not interested in a dictionary object, just a sorted collection
>> where I can pass in a delegate to do the sort. I am also not interested
>> in calling ArrayList's Sort() as I want the collection to automatically
>> maintain its sort order when objects are inserted into it.
>>
>> I looked in the System.Collections and System.Collections.Specialized but
>> did not find a sorted collection class which was not also a dictionary.
>>
>
>