Click here to Skip to main content
15,897,187 members
Home / Discussions / C#
   

C#

 
GeneralRe: Hashtable v.s. Dictionary Pin
George_George5-Jun-08 18:24
George_George5-Jun-08 18:24 
AnswerRe: Hashtable v.s. Dictionary Pin
telha5-Jun-08 20:23
telha5-Jun-08 20:23 
GeneralRe: Hashtable v.s. Dictionary Pin
Guffa5-Jun-08 22:56
Guffa5-Jun-08 22:56 
GeneralRe: Hashtable v.s. Dictionary Pin
George_George8-Jun-08 22:50
George_George8-Jun-08 22:50 
GeneralRe: Hashtable v.s. Dictionary Pin
Guffa9-Jun-08 1:18
Guffa9-Jun-08 1:18 
GeneralRe: Hashtable v.s. Dictionary Pin
George_George9-Jun-08 1:27
George_George9-Jun-08 1:27 
GeneralRe: Hashtable v.s. Dictionary Pin
George_George8-Jun-08 23:01
George_George8-Jun-08 23:01 
GeneralRe: Hashtable v.s. Dictionary Pin
Guffa9-Jun-08 6:28
Guffa9-Jun-08 6:28 
George_George wrote:
I did some search from MSDN, I think Dictionary is using either IEqualityComparer.Equals or System.IEquatable, while Hashtable is using Object.GetHashCode to check whether two keys' are the same?


Both the HashTable and the Dictionary uses both the GetHashCode method and some kind of comparer. The hash code is used to determine a bucket for the item, and the comparer is used when looping through the items in the bucket to find the correct item.

HashTable uses the Equals method if no customer key comparer is specified. Dictionary uses the default EqualityComparer for the key if no custom key comparer is specified.

George_George wrote:
What means "Every key in a Dictionary must be unique according to the dictionary's equality comparer" -- I understand key in a Dictionary should have an equality comparer, but I do not know what means an equality comparer for a Dictionary itself?


That's the same thing. The equality comparer for the dictionary is only used to compare keys.

Despite everything, the person most likely to be fooling you next is yourself.

GeneralRe: Hashtable v.s. Dictionary Pin
George_George9-Jun-08 17:05
George_George9-Jun-08 17:05 
GeneralRe: Hashtable v.s. Dictionary Pin
Guffa9-Jun-08 21:25
Guffa9-Jun-08 21:25 
GeneralRe: Hashtable v.s. Dictionary Pin
George_George11-Jun-08 1:19
George_George11-Jun-08 1:19 
AnswerRe: Hashtable v.s. Dictionary Pin
Alan Balkany6-Jun-08 3:48
Alan Balkany6-Jun-08 3:48 
GeneralRe: Hashtable v.s. Dictionary Pin
George_George8-Jun-08 22:51
George_George8-Jun-08 22:51 
GeneralRe: Hashtable v.s. Dictionary Pin
Alan Balkany9-Jun-08 3:11
Alan Balkany9-Jun-08 3:11 
GeneralRe: Hashtable v.s. Dictionary Pin
George_George9-Jun-08 17:01
George_George9-Jun-08 17:01 
GeneralRe: Hashtable v.s. Dictionary Pin
Alan Balkany10-Jun-08 3:12
Alan Balkany10-Jun-08 3:12 
GeneralRe: Hashtable v.s. Dictionary Pin
George_George11-Jun-08 1:22
George_George11-Jun-08 1:22 
GeneralRe: Hashtable v.s. Dictionary Pin
Alan Balkany11-Jun-08 3:23
Alan Balkany11-Jun-08 3:23 
GeneralRe: Hashtable v.s. Dictionary Pin
George_George11-Jun-08 3:33
George_George11-Jun-08 3:33 
GeneralRe: Hashtable v.s. Dictionary Pin
Alan Balkany11-Jun-08 3:36
Alan Balkany11-Jun-08 3:36 
GeneralRe: Hashtable v.s. Dictionary Pin
George_George11-Jun-08 16:40
George_George11-Jun-08 16:40 
GeneralRe: Hashtable v.s. Dictionary Pin
Alan Balkany12-Jun-08 3:07
Alan Balkany12-Jun-08 3:07 
GeneralRe: Hashtable v.s. Dictionary Pin
George_George12-Jun-08 3:13
George_George12-Jun-08 3:13 
GeneralRe: Hashtable v.s. Dictionary Pin
Alan Balkany12-Jun-08 3:17
Alan Balkany12-Jun-08 3:17 
GeneralRe: Hashtable v.s. Dictionary Pin
George_George12-Jun-08 23:26
George_George12-Jun-08 23:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.