Home > .Net CLR > HybridDictionary

HybridDictionary

HybridDictionary provides an efficient way to manage unknown size list.

This is the MSDN description about HybridDictionary:

“This class is recommended for cases where the number of elements in a dictionary is unknown. It takes advantage of the improved performance of a ListDictionary with small collections, and offers the flexibility of switching to a Hashtable which handles larger collections better than ListDictionary.”

In general if the number of elements is less than 10 then ListDictionary is the best choice, but for more than 10 elements Hashtable should be used. If you do not know how many memeber your collection will include, then you should HybridDictionary. It uses the ListDictionary class to manage the collection when there are only a few elements, then it automatically converts the elements into Hashtable when their numbers exceed optimum size of ListDictionary.

public class HybridDictionary :
IDictionary, ICollection, IEnumerable

Advertisements
Categories: .Net CLR
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: