Question: 4. Strings as Keys In a popular programming language, non-empty strings are hashed using the follow- where s, is the ASCII code (http://www.asciitable.com/) for the

4. Strings as Keys In a popular programming language, non-empty strings are hashed using the follow- where s, is the ASCII code (http://www.asciitable.com/) for the ith character of string s (starting at 0 and counting from left to right), Isl is the length of s, and m is the size of the hash table. We consider 7-bit ASCII codes, so that each character is encoded as a number between 0 and 127 (included) 4.1 If 15122 strings were stored in a hash table of size 1223 using separate chaining, what would the load factor of the table be? If the strings above were equally distributed in the hash table, what does the load factor tell you about the length The load factor is Each chain has length 4.2 Using the hash function above with a table size of 1223, give an example of two different strings that would "collide" in the hash table and would be stored in the same chain. Show your work. (For your own sake, and ours, use strings of up to 2 printable characters.) 4. Strings as Keys In a popular programming language, non-empty strings are hashed using the follow- where s, is the ASCII code (http://www.asciitable.com/) for the ith character of string s (starting at 0 and counting from left to right), Isl is the length of s, and m is the size of the hash table. We consider 7-bit ASCII codes, so that each character is encoded as a number between 0 and 127 (included) 4.1 If 15122 strings were stored in a hash table of size 1223 using separate chaining, what would the load factor of the table be? If the strings above were equally distributed in the hash table, what does the load factor tell you about the length The load factor is Each chain has length 4.2 Using the hash function above with a table size of 1223, give an example of two different strings that would "collide" in the hash table and would be stored in the same chain. Show your work. (For your own sake, and ours, use strings of up to 2 printable characters.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
