Add



Collections in .Net

In .Net, there are Collections available. Collections are of 3 kinds:

1. List

When order is important (It does not need to be sorted order but in order.)

2. UnOrdered

When order is not important then unordered is used.

3. Dictionary

In Key/Value pairs form values are stored. For example, NIC card details. Note that key is never duplicated.

Examples

Examples of .Net collections are:

a. ArrayList

It is used when Insertion/Deletion is not much required.

b. SortedList

It represents Linked-List. It is used when Insertion or Deletion is much required.

c. HashTable

It is used when fast search is required. It is recommended to give prime number or atleast give odd number as parameter to its constructor because in other case (if you do not use odd number) then it affects Hashtable algorithm.

d. Stack

It is used when Last In First Out (LIFO) is required. There are 3 main methods of Stack i.e. push(), pop(), and peep().

e. Queue

It is used when First In First Out (FIFO) is required.