Collections
| ArrayList | .Add, .Remove, .Insert(4, "test"), .Sort() (uses objects IComparable.CompareTo), .Sort(new ReverseSort()), .BinarySearch(o) (returns int index), .AddRange, .Synchronized(arrayList) to return syncrhonized version. |
| Queue | .Enqueue, .Dequeue, .Clear |
| Stack | .Push, .Pop, .Clear |
| BitVector32 | for storing 32 or fewers bools |
| Hashtable | |
| SortedList | Automatically sorts by key |
| StringDictionary | (string, string) |
| ListDictionary | optimised for less than 10 items |
| HybridDictionary | uses ListDictionary when less than 10 then switches to Hashtable |
| NameValueCollection | Can have duplicate keys, .GetValues("keyName") |
Generic Collections
| List<T> | |
| Dictionary<T,U> | |
| Queue<T> | |
| Stack<T> | |
| SortedList<T,U> | |
| Collection<T> | |
| ReadOnlyCollection<T> | |
public class ReverseSort : IComparer {
int IComparer.Compare(object x, object y) {
return ((new CaseInsensitiveComparer()).Compare(y,x);
}
}