Click here to Skip to main content
15,903,175 members
Home / Discussions / C#
   

C#

 
AnswerRe: T9 dictionary in c# Pin
Dan Neely25-Jun-07 5:21
Dan Neely25-Jun-07 5:21 
QuestionObject as disctionary key Pin
AndrusM25-Jun-07 1:36
AndrusM25-Jun-07 1:36 
AnswerRe: Object as disctionary key Pin
originSH25-Jun-07 1:48
originSH25-Jun-07 1:48 
GeneralRe: Object as disctionary key Pin
AndrusM25-Jun-07 2:36
AndrusM25-Jun-07 2:36 
GeneralRe: Object as disctionary key Pin
Pete O'Hanlon25-Jun-07 3:01
mvePete O'Hanlon25-Jun-07 3:01 
GeneralRe: Object as disctionary key Pin
AndrusM25-Jun-07 3:16
AndrusM25-Jun-07 3:16 
AnswerRe: Object as disctionary key Pin
Guffa25-Jun-07 4:05
Guffa25-Jun-07 4:05 
GeneralRe: Object as disctionary key Pin
AndrusM25-Jun-07 4:27
AndrusM25-Jun-07 4:27 
AnswerRe: Object as disctionary key Pin
Guffa25-Jun-07 7:51
Guffa25-Jun-07 7:51 
GeneralRe: Object as disctionary key Pin
AndrusM26-Jun-07 0:05
AndrusM26-Jun-07 0:05 
AnswerRe: Object as disctionary key Pin
Guffa26-Jun-07 2:13
Guffa26-Jun-07 2:13 
GeneralRe: Object as disctionary key Pin
AndrusM26-Jun-07 4:47
AndrusM26-Jun-07 4:47 
AnswerRe: Object as disctionary key Pin
Guffa26-Jun-07 6:08
Guffa26-Jun-07 6:08 
GeneralRe: Object as disctionary key Pin
originSH25-Jun-07 4:30
originSH25-Jun-07 4:30 
Hash codes are used for HashTables and Dictionaries, when a key is added the Hash code of the key is used to figure out which bucket the key should be stored in, this is how the searching for the key is speeded up.

http://msdn2.microsoft.com/en-us/library/4yh14awz.aspx[^]


Here is the exact code from the base class libary for when something is inserted into a dictionary:

int num = this.comparer.GetHashCode(key) & 0x7fffffff;
for (int i = this.buckets[num % this.buckets.Length]; i >= 0; i = this.entries[i].next)




AndrusM wrote:
In this case I can use string as distionary key and I think string comparison works OK .


Yes, using a string would work very well, but I thought you wanted to use your custom Key class?
GeneralRe: Object as disctionary key Pin
AndrusM25-Jun-07 5:31
AndrusM25-Jun-07 5:31 
GeneralRe: Object as disctionary key Pin
originSH25-Jun-07 5:45
originSH25-Jun-07 5:45 
QuestionThe modifier 'public' is not valid for this item. Pin
steffw25-Jun-07 1:35
steffw25-Jun-07 1:35 
AnswerRe: The modifier 'public' is not valid for this item. Pin
originSH25-Jun-07 1:52
originSH25-Jun-07 1:52 
GeneralRe: The modifier 'public' is not valid for this item. Pin
steffw25-Jun-07 2:54
steffw25-Jun-07 2:54 
AnswerRe: The modifier 'public' is not valid for this item. Pin
Guffa25-Jun-07 5:36
Guffa25-Jun-07 5:36 
Questiongetting id of row Pin
tauras8125-Jun-07 1:26
tauras8125-Jun-07 1:26 
AnswerRe: getting id of row Pin
Sathesh Sakthivel25-Jun-07 1:32
Sathesh Sakthivel25-Jun-07 1:32 
AnswerRe: getting id of row Pin
Revathij25-Jun-07 1:59
Revathij25-Jun-07 1:59 
QuestionHow to view a RPT file in my application Pin
i.rabek25-Jun-07 1:26
i.rabek25-Jun-07 1:26 
Questiongetting id of row Pin
tauras8125-Jun-07 1:23
tauras8125-Jun-07 1:23 

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.