Hash Table Basics Exercises

  < Previous  Next >
Complete the following individually, then turn to a neighbor to confirm your answers.
  1. What is the underlying data structure for a hash table?
  2. A _______ determines the location to start to look in a hash table for a key.
  3. What would the hash function look like if a string is used as the key?
  4. What are the requirements for a good hash function?
  5. Insert the following numbers into a hash table of size 7 and draw the resulting hash table:
    • 0
    • 1
    • 4
    • 9
    • 16
  6. Calculate the load factor α for the previous example.
  7. Given a hash table with 7 entries that uses separate chaining a hash function that uses modulo arithmetic, draw the hash table and it's contents after inserting the following numbers: 7, 11, 71, 42, 13, 49.
  8. Calculate the load factor α for the previous example.

Last Modified: