Category: Collections in C Sharp

Collections in C Sharp

BitArray

BitArray

The BitArray class supports a collection of bits. Because it stores bits rather than objects, BitArray has capabilities different from those of the other collections. However, it still supports the basic collection underpinning by...

Queue

Queue

Another familiar data structure is the queue, which is a first-in, first-out list. That is, the first item put in a queue is the first item retrieved. Queues are common in real life. For...

Stack

Stack

As most readers know, a stack is a first-in, last-out list. To visualize a stack, imagine a stack of plates on a table. The first plate put down is the last one to be...

SortedList

SortedList

The SortedList class represents a collection of key-and-value pairs that are sorted by the keys and are accessible by key and by index.   A sorted list is a combination of an array and...

HashTable

HashTable

The Hashtable class represents a collection of key-and-value pairs that are organized based on the hash code of the key. It uses the key to access the elements in the collection.   A hash...

ArrayList

ArrayList

The ArrayList class supports dynamic arrays, which can grow or shrink as needed. In C#, standard arrays are of a fixed length, which cannot be changed during program execution. This means you must know...

Introducing Collections

Introducing Collections

Collection classes are specialized classes for data storage and retrieval. These classes provide support for stacks, queues, lists, and hash tables. Most collection classes implement the same interfaces. Collection classes serve various purposes, such...