Hash table
what is hash table & Dictionery??
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Atul KumarRank #1,527 · 1K reputationPosted Jul 27, 2012, 3:06 AM EDT
There is generic version available for Dictionary in .net.
Hashtable is a collection of key/value pairs that are organized based on the hash code of the key.
Hemant KumarRank #1,202 · 1.5K reputationPosted Jul 27, 2012, 4:14 AM EDT
Dictionary provides generic types
, whichallows to create dictionary of any type. Where as HashTable will store values in
the form of object. So, while using a collection of primitive types such as
integer, hashtable will have additional cost of boxing and unboxing, where as
dictionary is generic, it will not have additional cost of boxing and
unboxing.
If the collection if of type int,datetime,float etc, Dictionary provides
better performance than hashtable.
If the collection is of type custom object, Both will provide same
performance.