Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A hash table is a data structure. More information can be found <a href="http://en.wikipedia.org/wiki/Hash_table" rel="nofollow noreferrer">when looking for more general information</a>.</p> <p>1) A default search in lists are linear (all elements need to be traversed). Perfect hashing (no collisions) allows for constant time lookups in the worst case. More collisions result in a slower lookup.</p> <p>2) Hash collisions are practically unavoidable when hashing a random subset of a large set of possible keys. Therefore, most hash table implementations have some collision resolution strategy to handle such events. .NET's Hashtable implementation seems to use <a href="http://en.wikipedia.org/wiki/Double_hashing" rel="nofollow noreferrer">double hashing</a>.</p> <p>3) This is something you shouldn't worry about, as long as you provide proper hash codes. When interested, read the wiki article about hash tables, which explains several techniques.</p> <p>UPDATE: There is <a href="https://stackoverflow.com/questions/1089132/net-hashtable-vs-dictionary-can-the-dictionary-be-as-fast">a difference</a> in the implementation of Hashtable and Dictionaries in collision handling. Apparently Hashtable is obsolete and <a href="http://msdn.microsoft.com/en-us/library/xfhwa508.aspx" rel="nofollow noreferrer">Dictionary</a> or <a href="http://msdn.microsoft.com/en-us/library/bb359438.aspx" rel="nofollow noreferrer">HashSet</a> is preferred.</p> <p>As Jim Mischel mentions, you should override GetHashCode as well as Equals. Inserting items which are equal isn't possible, but items with the same hashcode are handled by the collection type you choose.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload