System.Collections is the .NET framework library used to represent the implementation and usage of DataStructures. A collection is a structured data type that stores data and provides operations for adding data to the collection, removing data from the collection, updating data in the collection, as well as operations for setting and returning the values of different attributes of the collection. Collections can be broken down into Linear and Non-Linear collections as shown below:
Linear Collections: A Linear collection is a list of elements where one element follows the previous element. Elements in a linear collection are normally ordered by position. Linear collections are further categorized into Data access collections and Sequential access collections as explained below- Data Access Collections
- Array: Derived from System.Array namespace. One dimensional, Multi dimensional, Parameter and Jagged are the types of Arrays. Length, GetLength, Rank, GetType, and GetElementType are some of the important properties and functions of Arrays
- ArrayList: Derives from System.Collections namespace. Static arrays has a limitation when the size is unknown in advance or the size changes during execution. ArrayList is a type of array which solves this problem as this automatically resizes itself when the array is out of storage space. The ArraList has a Capacity property that stores its size, which is 0 elements by default and increases by 4 elements as needed. Add, AddRange, Capacity, Clear, Contains, CopyTo, Count, GetEnumerator, GetRange, IndexOf, Insert, InsertRange, Item, Remove, RemoveAt, Reverse, Sort, ToArray and TrimToSize are some of the noted members of ArrayList
- String: Derives from System.String namespace. C# strings allows to place escape characters inside the strings. Escape characters are used to place format characters such as line breaks and tab stops within a string. An escape character begins with a backslash (\) and is followed by a single letter that represents the format. Empty is the available field to use represent the String and Chars and Length are the properties of String
- StringBuilder
- Struct
- Sequential Access Collections
- List
- LinkedList
- HashTable
- Dictionary
- SortedList
- Stack
- Queue
- Hierarchical Collections
- Tree
- BinaryTree
- Heap
- Grouped Collections
- Set
- Graph
- Network