Sunday, 6 October 2013

Collections in C#

Collections are group of records which can be treated as single logical unit. Collection classes are specialized classes for data storage and retrieval.Collection classes are derived from System.Collection namespace
Dot net  collections are divided into four categories:-
1. Indexed based
Indexed based collections helps to access the value of the row using internally generated index by the collections. They are two types:-
Array
List
2. Key value pair
Key value pair based collections helps to access the value of the row using user defined key. They are two types:-
Hashtable: - Uses a key to access elements in the collections
Sorted list: - Uses a key as well as an index to access elements in a list. It is a combination of an array and a hashtable.If we access items using an index, it is an arraylist and if we access the items using a key, it is a hashtable. The collection of items is always sorted by the key valu e.
3. Prioritized collections
Stacks
Queue
Queues and stacks helps to access data in a particular sequence.
Queues uses FIFO(First in First out) methodology.
Stacks uses LIFO(Last in First out) methodology.
4. Specialized collection
String collections

Hybrid dictionary

No comments:

Post a Comment