Monday, 5 March 2018

Collection in C#

Reference Link:
1. http://www.tutorialsteacher.com/csharp/csharp-collection
2. http://www.c-sharpcorner.com/UploadFile/736bf5/collection-in-C-Sharp/
3.https://www.tutorialspoint.com/csharp/csharp_collections.htm 
Non-generic Collections Usage
ArrayList ArrayList stores objects of any type like an array. However, there is no need to specify the size of the ArrayList like with an array as it grows automatically.
SortedList SortedList stores key and value pairs. It automatically arranges elements in ascending order of key by default. C# includes both, generic and non-generic SortedList collection.
Stack Stack stores the values in LIFO style (Last In First Out). It provides a Push() method to add a value and Pop() & Peek() methods to retrieve values. C# includes both, generic and non-generic Stack.
Queue Queue stores the values in FIFO style (First In First Out). It keeps the order in which the values were added. It provides an Enqueue() method to add values and a Dequeue() method to retrieve values from the collection. C# includes generic and non-generic Queue.
Hashtable Hashtable stores key and value pairs. It retrieves the values by comparing the hash value of the keys.
BitArray BitArray manages a compact array of bit values, which are represented as Booleans, where true indicates that the bit is on (1) and false indicates the bit is off (0).


For more details click on the link that is given in the table.
Also download the file for more information:
https://drive.google.com/file/d/1ZgkfZpeil3tXdccLpbFE2HjZmfgnjypK/view?usp=sharing




































No comments:

Post a Comment