CS210 Lab: Hash Table Postlab


Postlab Exercise:

This postlab exercise is broken down into two parts:

Part 1

For the following two questions, use the following values:

   67 46 88 91 123 141 152 155 178 288 390 399 465 572 621 734
  1. Draw a diagram to show how the values are inserted into a hash table with 20 positions. Use the division method of hashing and the linear probing method of resolving collisions.

  2. Draw a diagram to show how the values are inserted into a hash table that uses the hash function key % 10 to determine into which of ten chains to put the value.

Part 2

This question is based on the lab exercise that you have just completed.

  1. When implementing programs that take passwords, you might want to hide the user input, or display stars instead. You can do this using a couple of functions:

    Look these up using "Help" and try to modify your code so that you program will run something like the following:

    Login: mary
    Password: ********
    Authentication successful
    Login:
    

For Answers, click here
Back to Hash Table Lab click here

CS Dept Home Page
CS Dept Class Files
CS210 Class Files

Copyright: Department of Computer Science, University of Regina.