NetTopologySuite
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Wintellect.PowerCollections.BigList< T > Class Template Reference

BigList<T> provides a list of items, in order, with indices of the items ranging from 0 to one less than the count of items in the collection. BigList<T> is optimized for efficient operations on large (>100 items) lists, especially for insertions, deletions, copies, and concatinations. More...

Inheritance diagram for Wintellect.PowerCollections.BigList< T >:
Wintellect.PowerCollections.ListBase< T > Wintellect.PowerCollections.CollectionBase< T >

Public Member Functions

 BigList ()
 Creates a new BigList. The BigList is initially empty. More...
 
 BigList (IEnumerable< T > collection)
 Creates a new BigList initialized with the items from collection , in order. More...
 
 BigList (IEnumerable< T > collection, int copies)
 Creates a new BigList initialized with a given number of copies of the items from collection , in order. More...
 
 BigList (BigList< T > list)
 Creates a new BigList that is a copy of list . More...
 
 BigList (BigList< T > list, int copies)
 Creates a new BigList that is several copies of list . More...
 
sealed override void Clear ()
 Removes all of the items from the BigList. More...
 
sealed override void Insert (int index, T item)
 Inserts a new item at the given index in the BigList. All items at indexes equal to or greater than index move up one index. More...
 
void InsertRange (int index, IEnumerable< T > collection)
 Inserts a collection of items at the given index in the BigList. All items at indexes equal to or greater than index increase their indices by the number of items inserted. More...
 
void InsertRange (int index, BigList< T > list)
 Inserts a BigList of items at the given index in the BigList. All items at indexes equal to or greater than index increase their indices by the number of items inserted. More...
 
sealed override void RemoveAt (int index)
 Removes the item at the given index in the BigList. All items at indexes greater than index move down one index. More...
 
void RemoveRange (int index, int count)
 Removes a range of items at the given index in the Deque. All items at indexes greater than index move down count indices in the Deque. More...
 
sealed override void Add (T item)
 Adds an item to the end of the BigList. The indices of all existing items in the Deque are unchanged. More...
 
void AddToFront (T item)
 Adds an item to the beginning of the BigList. The indices of all existing items in the Deque are increased by one, and the new item has index zero. More...
 
void AddRange (IEnumerable< T > collection)
 Adds a collection of items to the end of BigList. The indices of all existing items are unchanged. The last item in the added collection becomes the last item in the BigList. More...
 
void AddRangeToFront (IEnumerable< T > collection)
 Adds a collection of items to the front of BigList. The indices of all existing items in the are increased by the number of items in collection . The first item in the added collection becomes the first item in the BigList. More...
 
BigList< T > Clone ()
 Creates a new BigList that is a copy of this list. More...
 
BigList< T > CloneContents ()
 Makes a deep clone of this BigList. A new BigList is created with a clone of each element of this set, by calling ICloneable.Clone on each element. If T is a value type, then this method is the same as Clone. More...
 
void AddRange (BigList< T > list)
 Adds a BigList of items to the end of BigList. The indices of all existing items are unchanged. The last item in list becomes the last item in this list. The added list list is unchanged. More...
 
void AddRangeToFront (BigList< T > list)
 Adds a BigList of items to the front of BigList. The indices of all existing items are increased by the number of items in list . The first item in list becomes the first item in this list. The added list list is unchanged. More...
 
BigList< T > GetRange (int index, int count)
 Creates a new list that contains a subrange of elements from this list. The current list is unchanged. More...
 
sealed override IList< T > Range (int index, int count)
 Returns a view onto a sub-range of this list. Items are not copied; the returned IList<T> is simply a different view onto the same underlying items. Changes to this list are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the view, but insertions and deletions in the underlying list do not. More...
 
sealed override IEnumerator< T > GetEnumerator ()
 Enumerates all of the items in the list, in order. The item at index 0 is enumerated first, then the item at index 1, and so on. Usually, the foreach statement is used to call this method implicitly. More...
 
new BigList< TDest > ConvertAll< TDest > (Converter< T, TDest > converter)
 Convert the list to a new list by applying a delegate to each item in the collection. The resulting list contains the result of applying converter to each item in the list, in order. The current list is unchanged. More...
 
void Reverse ()
 Reverses the current list in place. More...
 
void Reverse (int start, int count)
 Reverses the items in the range of count items starting from startIndex , in place. More...
 
void Sort ()
 Sorts the list in place. More...
 
void Sort (IComparer< T > comparer)
 Sorts the list in place. A supplied IComparer<T> is used to compare the items in the list. More...
 
void Sort (Comparison< T > comparison)
 Sorts the list in place. A supplied Comparison<T> delegate is used to compare the items in the list. More...
 
int BinarySearch (T item)
 Searches a sorted list for an item via binary search. The list must be sorted in the order defined by the default ordering of the item type; otherwise, incorrect results will be returned. More...
 
int BinarySearch (T item, IComparer< T > comparer)
 Searches a sorted list for an item via binary search. The list must be sorted by the ordering defined by the passed IComparer<T> interface; otherwise, incorrect results will be returned. More...
 
int BinarySearch (T item, Comparison< T > comparison)
 Searches a sorted list for an item via binary search. The list must be sorted by the ordering defined by the passed Comparison<T> delegate; otherwise, incorrect results will be returned. More...
 
- Public Member Functions inherited from Wintellect.PowerCollections.ListBase< T >
override IEnumerator< T > GetEnumerator ()
 Enumerates all of the items in the list, in order. The item at index 0 is enumerated first, then the item at index 1, and so on. More...
 
override bool Contains (T item)
 Determines if the list contains any item that compares equal to item . The implementation simply checks whether IndexOf(item) returns a non-negative value. More...
 
override void Add (T item)
 Adds an item to the end of the list. This method is equivalent to calling: More...
 
override bool Remove (T item)
 Searches the list for the first item that compares equal to item . If one is found, it is removed. Otherwise, the list is unchanged. More...
 
virtual void CopyTo (T[] array)
 Copies all the items in the list, in order, to array , starting at index 0. More...
 
override void CopyTo (T[] array, int arrayIndex)
 Copies all the items in the list, in order, to array , starting at arrayIndex . More...
 
virtual void CopyTo (int index, T[] array, int arrayIndex, int count)
 Copies a range of elements from the list to array , starting at arrayIndex . More...
 
virtual new IList< T > AsReadOnly ()
 Provides a read-only view of this list. The returned IList<T> provides a view of the list that prevents modifications to the list. Use the method to provide access to the list without allowing changes. Since the returned object is just a view, changes to the list will be reflected in the view. More...
 
virtual T Find (Predicate< T > predicate)
 Finds the first item in the list that satisfies the condition defined by predicate . If no item matches the condition, than the default value for T (null or all-zero) is returned. More...
 
virtual bool TryFind (Predicate< T > predicate, out T foundItem)
 Finds the first item in the list that satisfies the condition defined by predicate . More...
 
virtual T FindLast (Predicate< T > predicate)
 Finds the last item in the list that satisfies the condition defined by predicate . If no item matches the condition, than the default value for T (null or all-zero) is returned. More...
 
virtual bool TryFindLast (Predicate< T > predicate, out T foundItem)
 Finds the last item in the list that satisfies the condition defined by predicate . More...
 
virtual int FindIndex (Predicate< T > predicate)
 Finds the index of the first item in the list that satisfies the condition defined by predicate . If no item matches the condition, -1 is returned. More...
 
virtual int FindIndex (int index, Predicate< T > predicate)
 Finds the index of the first item, in the range of items extending from index to the end, that satisfies the condition defined by predicate . If no item matches the condition, -1 is returned. More...
 
virtual int FindIndex (int index, int count, Predicate< T > predicate)
 Finds the index of the first item, in the range of count items starting from index , that satisfies the condition defined by predicate . If no item matches the condition, -1 is returned. More...
 
virtual int FindLastIndex (Predicate< T > predicate)
 Finds the index of the last item in the list that satisfies the condition defined by predicate . If no item matches the condition, -1 is returned. More...
 
virtual int FindLastIndex (int index, Predicate< T > predicate)
 Finds the index of the last item, in the range of items extending from the beginning of the list to index , that satisfies the condition defined by predicate . If no item matches the condition, -1 is returned. More...
 
virtual int FindLastIndex (int index, int count, Predicate< T > predicate)
 Finds the index of the last item, in the range of count items ending at index , that satisfies the condition defined by predicate . If no item matches the condition, -1 is returned. More...
 
virtual int IndexOf (T item)
 Finds the index of the first item in the list that is equal to item . More...
 
virtual int IndexOf (T item, int index)
 Finds the index of the first item, in the range of items extending from index to the end, that is equal to item . More...
 
virtual int IndexOf (T item, int index, int count)
 Finds the index of the first item, in the range of count items starting from index , that is equal to item . More...
 
virtual int LastIndexOf (T item)
 Finds the index of the last item in the list that is equal to item . More...
 
virtual int LastIndexOf (T item, int index)
 Finds the index of the last item, in the range of items extending from the beginning of the list to index , that is equal to item . More...
 
virtual int LastIndexOf (T item, int index, int count)
 Finds the index of the last item, in the range of count items ending at index , that is equal to item . More...
 
- Public Member Functions inherited from Wintellect.PowerCollections.CollectionBase< T >
override string ToString ()
 Shows the string representation of the collection. The string representation contains a list of the items in the collection. Contained collections (except string) are expanded recursively. More...
 

Static Public Member Functions

static BigList< T > operator+ (BigList< T > first, BigList< T > second)
 Concatenates two lists together to create a new list. Both lists being concatenated are unchanged. The resulting list contains all the items in first , followed by all the items in second . More...
 

Properties

sealed override int Count [get]
 Gets the number of items stored in the BigList. The indices of the items range from 0 to Count-1. More...
 
sealed override T this[int index] [get, set]
 Gets or sets an item in the list, by index. More...
 
- Properties inherited from Wintellect.PowerCollections.ListBase< T >
abstract override int Count [get]
 The property must be overridden by the derived class to return the number of items in the list. More...
 
abstract T this[int index] [get, set]
 The indexer must be overridden by the derived class to get and set values of the list at a particular index. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Wintellect.PowerCollections.ListBase< T >
 ListBase ()
 Creates a new ListBase. More...
 
- Protected Member Functions inherited from Wintellect.PowerCollections.CollectionBase< T >
 CollectionBase ()
 Creates a new CollectionBase. More...
 

Detailed Description

BigList<T> provides a list of items, in order, with indices of the items ranging from 0 to one less than the count of items in the collection. BigList<T> is optimized for efficient operations on large (>100 items) lists, especially for insertions, deletions, copies, and concatinations.

BigList<T> class is similar in functionality to the standard List<T> class. Both classes provide a collection that stores an set of items in order, with indices of the items ranging from 0 to one less than the count of items in the collection. Both classes provide the ability to add and remove items from any index, and the get or set the item at any index.

BigList<T> differs significantly from List<T> in the performance of various operations, especially when the lists become large (several hundred items or more). With List<T>, inserting or removing elements from anywhere in a large list except the end is very inefficient – every item after the point of inserting or deletion has to be moved in the list. The BigList<T> class, however, allows for fast insertions and deletions anywhere in the list. Furthermore, BigList<T> allows copies of a list, sub-parts of a list, and concatinations of two lists to be very fast. When a copy is made of part or all of a BigList, two lists shared storage for the parts of the lists that are the same. Only when one of the lists is changed is additional memory allocated to store the distinct parts of the lists.

Of course, there is a small price to pay for this extra flexibility. Although still quite efficient, using an index to get or change one element of a BigList, while still reasonably efficient, is significantly slower than using a plain List. Because of this, if you want to process every element of a BigList, using a foreach loop is a lot more efficient than using a for loop and indexing the list.

In general, use a List when the only operations you are using are Add (to the end), foreach, or indexing, or you are very sure the list will always remain small (less than 100 items). For large (>100 items) lists that do insertions, removals, copies, concatinations, or sub-ranges, BigList will be more efficient than List. In almost all cases, BigList is more efficient and easier to use than LinkedList.

Template Parameters
TThe type of items to store in the BigList.

Constructor & Destructor Documentation

Wintellect.PowerCollections.BigList< T >.BigList ( )

Creates a new BigList. The BigList is initially empty.

Creating a empty BigList takes constant time and consumes a very small amount of memory.

Wintellect.PowerCollections.BigList< T >.BigList ( IEnumerable< T >  collection)

Creates a new BigList initialized with the items from collection , in order.

Initializing the tree list with the elements of collection takes time O(N), where N is the number of items in collection .

Parameters
collectionThe collection used to initialize the BigList.
Exceptions
ArgumentNullExceptioncollection is null.
Wintellect.PowerCollections.BigList< T >.BigList ( IEnumerable< T >  collection,
int  copies 
)

Creates a new BigList initialized with a given number of copies of the items from collection , in order.

Initializing the tree list with the elements of collection takes time O(N + log K), where N is the number of items in collection , and K is the number of copies.

Parameters
copiesNumber of copies of the collection to use.
collectionThe collection used to initialize the BigList.
Exceptions
ArgumentOutOfRangeExceptioncopies is negative.
ArgumentNullExceptioncollection is null.
Wintellect.PowerCollections.BigList< T >.BigList ( BigList< T >  list)

Creates a new BigList that is a copy of list .

Copying a BigList takes constant time, and little additional memory, since the storage for the items of the two lists is shared. However, changing either list will take additional time and memory. Portions of the list are copied when they are changed.

Parameters
listThe BigList to copy.
Exceptions
ArgumentNullExceptionlist is null.
Wintellect.PowerCollections.BigList< T >.BigList ( BigList< T >  list,
int  copies 
)

Creates a new BigList that is several copies of list .

Creating K copies of a BigList takes time O(log K), and O(log K) additional memory, since the storage for the items of the two lists is shared. However, changing either list will take additional time and memory. Portions of the list are copied when they are changed.

Parameters
copiesNumber of copies of the collection to use.
listThe BigList to copy.
Exceptions
ArgumentNullExceptionlist is null.

Member Function Documentation

sealed override void Wintellect.PowerCollections.BigList< T >.Add ( item)

Adds an item to the end of the BigList. The indices of all existing items in the Deque are unchanged.

Adding an item takes, on average, constant time.

Parameters
itemThe item to add.
void Wintellect.PowerCollections.BigList< T >.AddRange ( IEnumerable< T >  collection)

Adds a collection of items to the end of BigList. The indices of all existing items are unchanged. The last item in the added collection becomes the last item in the BigList.

This method takes time O(M + log N), where M is the number of items in the collection , and N is the size of the BigList.

Parameters
collectionThe collection of items to add.
Exceptions
ArgumentNullExceptioncollection is null.
void Wintellect.PowerCollections.BigList< T >.AddRange ( BigList< T >  list)

Adds a BigList of items to the end of BigList. The indices of all existing items are unchanged. The last item in list becomes the last item in this list. The added list list is unchanged.

This method takes, on average, constant time, regardless of the size of either list. Although conceptually all of the items in list are copied, storage is shared between the two lists until changes are made to the shared sections.

Parameters
listThe list of items to add.
Exceptions
ArgumentNullExceptionlist is null.
void Wintellect.PowerCollections.BigList< T >.AddRangeToFront ( IEnumerable< T >  collection)

Adds a collection of items to the front of BigList. The indices of all existing items in the are increased by the number of items in collection . The first item in the added collection becomes the first item in the BigList.

This method takes time O(M + log N), where M is the number of items in the collection , and N is the size of the BigList.

Parameters
collectionThe collection of items to add.
Exceptions
ArgumentNullExceptioncollection is null.
void Wintellect.PowerCollections.BigList< T >.AddRangeToFront ( BigList< T >  list)

Adds a BigList of items to the front of BigList. The indices of all existing items are increased by the number of items in list . The first item in list becomes the first item in this list. The added list list is unchanged.

This method takes, on average, constant time, regardless of the size of either list. Although conceptually all of the items in list are copied, storage is shared between the two lists until changes are made to the shared sections.

Parameters
listThe list of items to add.
Exceptions
ArgumentNullExceptionlist is null.
void Wintellect.PowerCollections.BigList< T >.AddToFront ( item)

Adds an item to the beginning of the BigList. The indices of all existing items in the Deque are increased by one, and the new item has index zero.

Adding an item takes, on average, constant time.

Parameters
itemThe item to add.
int Wintellect.PowerCollections.BigList< T >.BinarySearch ( item)

Searches a sorted list for an item via binary search. The list must be sorted in the order defined by the default ordering of the item type; otherwise, incorrect results will be returned.

Parameters
itemThe item to search for.
Returns
Returns the index of the first occurence of item in the list. If the item does not occur in the list, the bitwise complement of the first item larger than item in the list is returned. If no item is larger than item , the bitwise complement of Count is returned.
Exceptions
InvalidOperationExceptionThe type T does not implement either the IComparable or IComparable<T> interfaces.
int Wintellect.PowerCollections.BigList< T >.BinarySearch ( item,
IComparer< T >  comparer 
)

Searches a sorted list for an item via binary search. The list must be sorted by the ordering defined by the passed IComparer<T> interface; otherwise, incorrect results will be returned.

Parameters
itemThe item to search for.
comparerThe IComparer<T> interface used to sort the list.
Returns
Returns the index of the first occurence of item in the list. If the item does not occur in the list, the bitwise complement of the first item larger than item in the list is returned. If no item is larger than item , the bitwise complement of Count is returned.
int Wintellect.PowerCollections.BigList< T >.BinarySearch ( item,
Comparison< T >  comparison 
)

Searches a sorted list for an item via binary search. The list must be sorted by the ordering defined by the passed Comparison<T> delegate; otherwise, incorrect results will be returned.

Parameters
itemThe item to search for.
comparisonThe comparison delegate used to sort the list.
Returns
Returns the index of the first occurence of item in the list. If the item does not occur in the list, the bitwise complement of the first item larger than item in the list is returned. If no item is larger than item , the bitwise complement of Count is returned.
sealed override void Wintellect.PowerCollections.BigList< T >.Clear ( )
virtual

Removes all of the items from the BigList.

Clearing a BigList takes constant time.

Implements Wintellect.PowerCollections.ListBase< T >.

BigList<T> Wintellect.PowerCollections.BigList< T >.Clone ( )

Creates a new BigList that is a copy of this list.

Copying a BigList takes constant time, and little additional memory, since the storage for the items of the two lists is shared. However, changing either list will take additional time and memory. Portions of the list are copied when they are changed.

Returns
A copy of the current list
BigList<T> Wintellect.PowerCollections.BigList< T >.CloneContents ( )

Makes a deep clone of this BigList. A new BigList is created with a clone of each element of this set, by calling ICloneable.Clone on each element. If T is a value type, then this method is the same as Clone.

If T is a reference type, it must implement ICloneable. Otherwise, an InvalidOperationException is thrown.

If T is a reference type, cloning the list takes time approximate O(N), where N is the number of items in the list.

Returns
The cloned set.
Exceptions
InvalidOperationExceptionT is a reference type that does not implement ICloneable.
new BigList<TDest> Wintellect.PowerCollections.BigList< T >.ConvertAll< TDest > ( Converter< T, TDest >  converter)

Convert the list to a new list by applying a delegate to each item in the collection. The resulting list contains the result of applying converter to each item in the list, in order. The current list is unchanged.

Template Parameters
TDestThe type each item is being converted to.
Parameters
converterA delegate to the method to call, passing each item in sourceCollection .
Returns
The resulting BigList from applying converter to each item in this list.
Exceptions
ArgumentNullExceptionconverter is null.
sealed override IEnumerator<T> Wintellect.PowerCollections.BigList< T >.GetEnumerator ( )

Enumerates all of the items in the list, in order. The item at index 0 is enumerated first, then the item at index 1, and so on. Usually, the foreach statement is used to call this method implicitly.

Enumerating all of the items in the list take time O(N), where N is the number of items in the list. Using GetEnumerator() or foreach is much more efficient than accessing all items by index.

Returns
An IEnumerator<T> that enumerates all the items in the list.
BigList<T> Wintellect.PowerCollections.BigList< T >.GetRange ( int  index,
int  count 
)

Creates a new list that contains a subrange of elements from this list. The current list is unchanged.

This method takes take O(log N), where N is the size of the current list. Although the sub-range is conceptually copied, storage is shared between the two lists until a change is made to the shared items.

If a view of a sub-range is desired, instead of a copy, use the more efficient Range method, which provides a view onto a sub-range of items.

Parameters
indexThe starting index of the sub-range.
countThe number of items in the sub-range. If this is zero, the returned list is empty.
Returns
A new list with the count items that start at index .
sealed override void Wintellect.PowerCollections.BigList< T >.Insert ( int  index,
item 
)
virtual

Inserts a new item at the given index in the BigList. All items at indexes equal to or greater than index move up one index.

The amount of time to insert an item is O(log N), no matter where in the list the insertion occurs. Inserting an item at the beginning or end of the list is O(N).

Parameters
indexThe index to insert the item at. After the insertion, the inserted item is located at this index. The first item has index 0.
itemThe item to insert at the given index.
Exceptions
ArgumentOutOfRangeExceptionindex is less than zero or greater than Count.

Implements Wintellect.PowerCollections.ListBase< T >.

void Wintellect.PowerCollections.BigList< T >.InsertRange ( int  index,
IEnumerable< T >  collection 
)

Inserts a collection of items at the given index in the BigList. All items at indexes equal to or greater than index increase their indices by the number of items inserted.

The amount of time to insert an arbitrary collection in the BigList is O(M + log N), where M is the number of items inserted, and N is the number of items in the list.

Parameters
indexThe index to insert the collection at. After the insertion, the first item of the inserted collection is located at this index. The first item has index 0.
collectionThe collection of items to insert at the given index.
Exceptions
ArgumentOutOfRangeExceptionindex is less than zero or greater than Count.
ArgumentNullExceptioncollection is null.
void Wintellect.PowerCollections.BigList< T >.InsertRange ( int  index,
BigList< T >  list 
)

Inserts a BigList of items at the given index in the BigList. All items at indexes equal to or greater than index increase their indices by the number of items inserted.

The amount of time to insert another BigList is O(log N), where N is the number of items in the list, regardless of the number of items in the inserted list. Storage is shared between the two lists until one of them is changed.

Parameters
indexThe index to insert the collection at. After the insertion, the first item of the inserted collection is located at this index. The first item has index 0.
listThe BigList of items to insert at the given index.
Exceptions
ArgumentOutOfRangeExceptionindex is less than zero or greater than Count.
ArgumentNullExceptionlist is null.
static BigList<T> Wintellect.PowerCollections.BigList< T >.operator+ ( BigList< T >  first,
BigList< T >  second 
)
static

Concatenates two lists together to create a new list. Both lists being concatenated are unchanged. The resulting list contains all the items in first , followed by all the items in second .

This method takes, on average, constant time, regardless of the size of either list. Although conceptually all of the items in both lists are copied, storage is shared until changes are made to the shared sections.

Parameters
firstThe first list to concatenate.
secondThe second list to concatenate.
Exceptions
ArgumentNullExceptionfirst or second is null.
sealed override IList<T> Wintellect.PowerCollections.BigList< T >.Range ( int  index,
int  count 
)
virtual

Returns a view onto a sub-range of this list. Items are not copied; the returned IList<T> is simply a different view onto the same underlying items. Changes to this list are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the view, but insertions and deletions in the underlying list do not.

If a copy of the sub-range is desired, use the GetRange method instead.

This method can be used to apply an algorithm to a portion of a list. For example:

Algorithms.ReverseInPlace(list.Range(3, 6))

will reverse the 6 items beginning at index 3.

Parameters
indexThe starting index of the view.
countThe number of items in the view.
Returns
A list that is a view onto the given sub-list.
Exceptions
ArgumentOutOfRangeExceptionindex or count is negative.
ArgumentOutOfRangeExceptionindex + count is greater than the size of this list.

Reimplemented from Wintellect.PowerCollections.ListBase< T >.

sealed override void Wintellect.PowerCollections.BigList< T >.RemoveAt ( int  index)
virtual

Removes the item at the given index in the BigList. All items at indexes greater than index move down one index.

The amount of time to delete an item in the BigList is O(log N), where N is the number of items in the list.

Parameters
indexThe index in the list to remove the item at. The first item in the list has index 0.
Exceptions
ArgumentOutOfRangeExceptionindex is less than zero or greater than or equal to Count.

Implements Wintellect.PowerCollections.ListBase< T >.

void Wintellect.PowerCollections.BigList< T >.RemoveRange ( int  index,
int  count 
)

Removes a range of items at the given index in the Deque. All items at indexes greater than index move down count indices in the Deque.

The amount of time to delete count items in the Deque is proportional to the distance of index from the closest end of the Deque, plus count : O(count + Min(index , Count - 1 - index )).

Parameters
indexThe index in the list to remove the range at. The first item in the list has index 0.
countThe number of items to remove.
Exceptions
ArgumentOutOfRangeExceptionindex is less than zero or greater than or equal to Count, or count is less than zero or too large.
void Wintellect.PowerCollections.BigList< T >.Reverse ( )

Reverses the current list in place.

void Wintellect.PowerCollections.BigList< T >.Reverse ( int  start,
int  count 
)

Reverses the items in the range of count items starting from startIndex , in place.

Parameters
startThe starting index of the range to reverse.
countThe number of items in range to reverse.
void Wintellect.PowerCollections.BigList< T >.Sort ( )

Sorts the list in place.

The Quicksort algorithm is used to sort the items. In virtually all cases, this takes time O(N log N), where N is the number of items in the list.

Values are compared by using the IComparable or IComparable<T> interface implementation on the type T.

Exceptions
InvalidOperationExceptionThe type T does not implement either the IComparable or IComparable<T> interfaces.
void Wintellect.PowerCollections.BigList< T >.Sort ( IComparer< T >  comparer)

Sorts the list in place. A supplied IComparer<T> is used to compare the items in the list.

The Quicksort algorithms is used to sort the items. In virtually all cases, this takes time O(N log N), where N is the number of items in the list.

Parameters
comparerThe comparer instance used to compare items in the collection. Only the Compare method is used.
void Wintellect.PowerCollections.BigList< T >.Sort ( Comparison< T >  comparison)

Sorts the list in place. A supplied Comparison<T> delegate is used to compare the items in the list.

The Quicksort algorithms is used to sort the items. In virtually all cases, this takes time O(N log N), where N is the number of items in the list.

Parameters
comparisonThe comparison delegate used to compare items in the collection.

Property Documentation

sealed override int Wintellect.PowerCollections.BigList< T >.Count
get

Gets the number of items stored in the BigList. The indices of the items range from 0 to Count-1.

Getting the number of items in the BigList takes constant time.

The number of items in the BigList.

sealed override T Wintellect.PowerCollections.BigList< T >.this[int index]
getset

Gets or sets an item in the list, by index.

Gettingor setting an item takes time O(log N), where N is the number of items in the list.

To process each of the items in the list, using GetEnumerator() or a foreach loop is more efficient that accessing each of the elements by index.

Parameters
indexThe index of the item to get or set. The first item in the list has index 0, the last item has index Count-1.
Returns
The value of the item at the given index.
Exceptions
ArgumentOutOfRangeExceptionindex is less than zero or greater than or equal to Count.

The documentation for this class was generated from the following file: