Cook Computing

Class SortedList

June 10, 2002 Written by Charles Cook

Following on from the previous entry, the System.Collections.SortedList class is available if you want a collection you can access by key but which is also ordered when enumerated. However I examined this class in mscorlib.dll using Anakrino and it is implemented using two arrays, one to hold the keys, the other to hold the values. Insertion and deletion is achieved by brute force copying of the array elements, so this is not going to perform very well for large collections (well, thats what I'd guess but I really should verify this with some sample code).

There is a useful brief overview of .NET collections in this article by Jeffrey Richter.

[I wonder how many developers recognized the origin of the name anakrino?]