One More Class Template Example
Recording
Hash
Tables
- A hash table is an abstract data type like an array
- A hash table uses a function that converts a key
value into an index that is used with an array of values
- The hash table function should be simple and fast to
execute
- Two
different hash table keys may produce the same index. That is
referred to as a collision. Collisions may be resolved
programmatically or not.
- Hash tables are usually very fast for look-ups
Examples
Example 14-1 - First Hash Table
Example
Example 14-2 - Use a hash table
to store a dictionary and play a game
Unscramble
Hash Table Questions - What makes one hash table better than another?
- How do you design a good hash table?
- Suppose
you are going to use a hash table to manage a data base application,
such as DeAnza student data. How would you design the hash?
|