Groups | Blog | Home
all groups > dotnet compact framework > february 2005 >

dotnet compact framework : SortedList in the CF ?


Carsten Marx
2/5/2005 11:07:15 AM
Hi,
is there a chance to get a SortedList ( like in
System.Collections.SortedList ) working in the CF?

Any ideas?

Regards
Andreas Wolff
2/5/2005 11:27:38 AM
Am Sat, 05 Feb 2005 11:07:15 +0100 schrieb Carsten Marx
<Carsten.Marx@uni-konstanz.de>:

[quoted text, click to view]

To my mind there is no SortedList in CF 1x available. But you could
implement a simple algorithm for sorting like Bubble-Sort. If you need
higher performance have a look at QuickSort, TrippleSort or HeapSort.

Daniel Moth
2/5/2005 12:39:16 PM
Carsten, search the archives for a number of pointers:
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework/search?group=microsoft.public.dotnet.framework.compactframework&q=sortedlist&qt_g=1&searchnow=Search+this+group

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


[quoted text, click to view]
Sergey Bogdanov
2/7/2005 8:43:17 AM
In addition to all replies you may use ArrayList with implemented your
own IComparer instead:

public class MyComparer : IComparer
{
int IComparer.Compare(Object x, Object y)
{
return((Item)x).Name.CompareTo( ((Item)y).Name);
}
}

....

myArrayList.Sort(new MyComparer());

Sergey Bogdanov
http://www.sergeybogdanov.com


[quoted text, click to view]
AddThis Social Bookmark Button