Discuss about a hash function


Discuss the

Q: Assume that a hash function has the following characteristics:

Keys 257 and 567 hash to 3.

Keys 987 and 313 hash to 6.

Keys 734, 189, and 575 hash to 5.

Keys 122, 391 hash to 8.

Assume that we perform insertions in the order 257, 987, 122, 575, 189, 734, 567, 313, 391.

(a)Indicate the position of the data if we use linear probe addressing to resolve collisions.

                                                                                  ht

0

1

2

3

4

5

6

7

8

9

10

 

 

 

 

 

 

 

 

 

 

 

(b) Indicate the position of the data if we use chaining with separate lists to resolve collisions.

                                     Hash Table

0

 

1

 

2

 

3

 

4

 

5

 

6

 

7

 

8

 

9

 

10


Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Discuss about a hash function
Reference No:- TGS01937588

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)