Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A hashtable of size 7 uses separate chaining to resolve collisions. A polynomial

ID: 3834978 • Letter: A

Question

A hashtable of size 7 uses separate chaining to resolve collisions. A polynomial hash function where a = 33 is used. Sketch the table's contents after the following words have been added in the exact order shown: find, edge, body, race, plan, beat, they You may find it useful to create a list of lowercase letters and their ASCII numeric value. The letter a's value is 97 and z's value is 122. A hashtable of size 7 uses linear probing to resolve collisions. Using Part A's polynomial hash function and sequence of words, sketch the table's contents after the words have been added.

Explanation / Answer

firstly will find the ascii values for all words..

find -> 102+105+110+100 ===> 417
edge -> 101+100+103+101 ===> 405
body -> 98+111+100+121 ===> 430
race -> 114+97+99+101 ===> 411
plan -> 112+108+97+110 ====> 427
beat -> 98+101+97+116 ====> 412
they -> 116+104+101+121 ===> 442


PART A -- separate chaining
---------
will do hashtable function hashing...
_answer = value % 7

find -> 417%7 ==> 4
edge -> 405%7 ==> 6
body -> 430%7 ==> 3
race -> 411%7 ==> 5
plan -> 427%7 ==> 0
beat -> 412%7 ==> 6
they -> 442%7 ==> 1

table
0 -> plan
1 -> they
2 ->
3 -> body
4 -> find
5 -> race
6 -> edge, beat


----------------------------------------------------------------------------------------------------------------
PART B -- linear probing

_answer = value % 7

find -> 417%7 ==> 4
edge -> 405%7 ==> 6
body -> 430%7 ==> 3
race -> 411%7 ==> 5
plan -> 427%7 ==> 0
beat -> 412%7 ==> 6
they -> 442%7 ==> 1


table
0 -> plan
1 -> beat
2 -> they
3 -> body
4 -> find
5 -> race
6 -> edge

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote