A hash table is a dictionary that lets you use a unique key to retrieve a corresponding value.
One of the nice things about a hash table is that the key and value can be of any object type. One of the nicer things about hash tables is that retrival time is not linearly related to the number of elements in the table. In other words, retrieving a value from a hash table with 100 elements is about the same as retrieving it from one with 100,000, since it doesn't have to search each element. Check out http://www.devx.com/vb2themax/Tip/18650 for more of an explanation. They come in handy when you need to store a bunch of related things and access them randomly instead of sequentially. Hence they are great for things like lookup tables, where you know you will need to retrieve a single value from a list. For example, I have a hashtable with a bunch of thermodynamic values associated with certain sequences of DNA bases. "ACGT", 2.3 "ACGG", 1.2 etc. "TTTA", -3.1 The application only ever needs one specfic value, but it would be a pain in the ass to loop through an array or collection and find the matching key, but the hashtable makes it trivial to get the proper value. Dim dThermVal = mht(sSequence.Substring(0,4)) mht is a hashtable and sSequence is a string of DNA bases Hope this gets you started in the right direction. On 5/19/05, Mike Appenzellar <[EMAIL PROTECTED]> wrote: > Can someone give me a basic explanation of the purpose of a hash table > and maybe how it would benefit someone using one in a real life > situation? Too much to learn out there! I understand that email might > not be the correct format to explain this so any links to articles > would be great too! > > > > Yahoo! Groups Links > > > > > > > -- Dean Fiala Very Practical Software, Inc http://www.vpsw.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
