SortedList in the CF ?

  • Thread starter Thread starter Carsten Marx
  • Start date Start date
C

Carsten Marx

Hi,
is there a chance to get a SortedList ( like in
System.Collections.SortedList ) working in the CF?

Any ideas?

Regards
Carsten
 
Am Sat, 05 Feb 2005 11:07:15 +0100 schrieb Carsten Marx
Hi,
is there a chance to get a SortedList ( like in
System.Collections.SortedList ) working in the CF?

Any ideas?

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.

- Andreas Wolff
 
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
 
Back
Top