Lab - 10 Open Ended Lab 55A

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Open Ended Lab

Data Structures and Algorithm

Exercise 1:

Design a code for the following:

Consider a hash table of size 13, and assume open addressing with linear probing. Design and
Use hash function of your own choice

1. Show what the hash table will look like after the following items are added in the order
shown.

26 54 77 90 27 30 28 52 96 65

2. What’s the load factor of the hash table after the values above are added?

3. If any of the values cause a collision, indicate which.

4. How many comparisons are needed to find 65 in the table?

Exercise 2

Suppose double hashing is used as the method for collision resolution.

1. Show what the hash table will look like after the following items are added in the order
shown.

26 54 77 90 27 30 28 52 96 65

2. How many comparisons are needed to find 65 in the table?

Exercise 3

Instead of numeric data, if the data is a string then define your hash function.

What values your hash function will generate for the following data if the table size is 11

Dog, Elephant, Lion, Dog

You might also like