Fall 2013 CSCI 202 Homework 11

Problem 1

Think about the implementation of a hash table involving the mapping of integers to strings using an array of size 10. Assume that the hash function is the following very simple function which merely returns the last digit of the key.

    private static int getSlot(int key) {
        return (key % 10) ;
    }

Using the command syntax of the last lab, draw the hash table after the following commands have been given.

2013   a
 202   b
2013   c
 181   d
 182   e
 255   f

Problems 3 and 4

Do problems 3 and 4 of last year’s final.

Problems 9 and 10

Do problems R14.9 and R14.10 on page 665 of the textbook.