CAN SOMEONE HELP ME WITH THESE COMPUTER SCIENCE QUESTIONS WITH AN EXPLANATION PLEASEEEE!!?

Assume you’re provided with the following all the list boy’s and girls artists (in this order):-
Linda, Patrick, Brian, Barbara, Alexandra, Neil, Christopher, Susannah.

(a) Given an initial hash perform defined by means of Hash worth = nnumber connected with letters around name
Show the way the given names can be stored in the hash dining room table of size 5 in which collisions tend to be resolved by way of chaining.

(b) show the way the given names can be stored in the hash stand of measurement 11 when collisions are generally resolved by using a second hash job defined simply by
Second Hash Price = 1 if the name may be for a woman (Linda, Barbara in addition to Susannah), 2 if the nme may be for a young man (Patrick, Brian, Christopher, Alexander, Neil) Properly expalin the method that you decide where each title is kept.

a.

So, the hash function would be:

h(x) = numLetters%tableSize, wherever tableSize can be 5.

h(Linda) = 5%5 = 0
h(Patrick) = 7%5 = 2
h(Barbara) = 7%5 = A COUPLE OF — A NEW collision w/ Patrick
.
.
.

That table is actually:

_Linda__
_______
_Patrick__Barbara_ <- chaining
.
.
.

You can finish others.

b.

Same idea:

h(x) = numLetters%tableSize, wherever tableSize can be 11.
h2(x) = returning 1 in the event girl or 2 in the event boy

h(Linda) = 5%11 = 5
h(Patrick) = 7%11 = 7
h(Barbara) = 7%11 = SEVERAL — A NEW collision w/ Patrick, invoke h2(x)
h2(Barbara) = 1
.
.
.

That table is actually:

________
_Barbara_
________
________
________
_Linda___
________
_Patrick__
.
.
.

Leave a Reply