Lot of times I see myself going back to the books to check which ‘collection’ would be the best suited for a particular activity I am performing in my code. After doing this several times I thougt it would be great to create a cheat-sheet of all the collections and where they can be used efficiently.
Now that I have had it for several months, I thought I should share it on the world wide web ! So help yourself -
ArrayList:
Simple, resizeable, index-based collection of objects
SortedList:
Sorted collection of name/value pairs of objects
Queue:
First In First Out (FIFO) collection of objects
Stack:
Last In First Out (LIFO) collection of objects
Hashtable:
Collection of name/value pairs of objects that allow retrieval by name or index
BitArray:
Compact collection of boolean values
StringCollection:
Simple collection of resizeable collection of strings
StringDictionary:
Collection of name/value pairs of strings that allow retrieval by name or index
ListDictionary:
Efficient collection to store small lists of objects
HybridDictionary:
Collection that uses ListDictionary for storage when the number of items in the collection is small, and then migrates the items to a Hashtable for large collection
NameValueCollection:
Collection of name/value pairs of strings that allows retrieval by name or index
| website design quote |