Find the smallest integer hashsize such that when the


Problem

Consider the set of all C++ reserved words.3 Consider these words as strings of 16 characters, where words less than 16 characters long are filled with blanks on the right.

(a) Devise an integer-valued function that will produce different values when applied to all the reserved words. [You may find it helpful to write a short program that reads the words from a file, applies the function you devise, and determines what collisions occur.]

(b) Find the smallest integer hash_size such that, when the values of your function are reduced by applying % hash_size, all the values remain distinct.

(c) [Challenging] Modify your function as necessary until you can achieve hash_size in the preceding part to be the same as the number of reserved words. (You will then have discovered a minimal perfect hash function for the C++ reserved words, mapping these words onto a table with no empty positions.)

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Find the smallest integer hashsize such that when the
Reference No:- TGS02642804

Expected delivery within 24 Hours