-
Book Overview & Buying
-
Table Of Contents
.NET 4.0 Generics Beginner's Guide
By :
Not all generic containers are geared to do each job well, as we already know it. Here is a table that will let you pick a generic container that supports some features listed in the left-hand column.
|
How to pick a list? |
Stack<T> |
Queue<T> |
List<T> |
LinkedList<T> |
Hash Set<T> |
Sorted Set<T> |
|---|---|---|---|---|---|---|
|
Allows duplicates |
Yes |
Yes |
Yes |
Yes |
No |
No |
|
Native integer indexing |
No |
No |
Yes |
No |
No |
No |
|
Keeps entries sorted |
No |
No |
No |
No |
No |
Yes |
|
Native sorting capability |
No |
No |
Yes |
No |
No |
Yes |
|
How to pick a dictionary? |
Dictionary <TKey,TValue> |
SortedDictionary <TKey,TValue> |
SortedList <TKey,TValue> |
|---|---|---|---|
|
Native sorting support |
No |
Yes |
Yes |
|
Zero-based indexing |
No |
No |
Yes |
|
Keeps entries sorted |
No |
Yes |
Yes |
You can download the GenGuru app from the book's website. It's a kind of wizard that will recommend the generic containers available in .NET Generics that you should use. It will ask you few questions and recommend...
Change the font size
Change margin width
Change background colour