My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for

Contents

Complete wiki list

SortedList  
The Sorted List data structure
Updated Aug 12, 2009 by hus...@gmail.com
public class SortedList<T> : IVisitableCollection<T>, IList<T>
{
      // Methods
      public override void Accept(IVisitor<T> visitor);
      public override void Add(T item);
      public override void Clear();
      public override int CompareTo(object obj);
      public override bool Contains(T item);
      public override void CopyTo(T[] array, int arrayIndex);
      public override IEnumerator<T> GetEnumerator();
      public override bool Remove(T item);
      public void RemoveAt(int index);

      // ...

      // Properties
      public IComparer<T> Comparer { get; }
      public T this[int i] { get; }

      // ...
}

The SortedList<T> class performs the same function as the default SortedList<TKey, TValue> class in the .NET framework, except that it removes two nuances we've found working with that class:

  • Duplicate items can occur in this SortedList (they're not allowed in the standard one).
  • Items are sorted by themselves, and no key is needed (the standard SortedList requires key-value pairs).

Sign in to add a comment
Powered by Google Project Hosting