Computer Science
CPSC131 Data Structures Programming Homework 10

CPSC131

Question Description

I’m trying to study for my Computer Science course and I need some help to understand this question.

Hash table 2 page homework


thank you for your help,

feel free to ask me anything

Unformatted Attachment Preview

CPSC 131 Homework 10 Deadline: Wednesday, May 1 (MonWed sections) Thursday, May 2 (TueThu sections) Turn in your submission as a hard copy in class. Questions 1–3 use the same elements and the same table size so that you have to do the arithmetic only once. #1 [3 points] Sketch a hash table of size N=11, where the hash function is hash(key) = key mod N and chaining is used to resolve collisions, after the following elements are inserted: 20, 42, 45, 49, 62, 72, 95 #2 [3 points] Sketch a hash table of size N=11, where the hash function is hash(key) = key mod N and linear probing is used to resolve collisions, after the following elements are inserted: 20, 42, 45, 49, 62, 72, 95 #3 [3 points] Sketch a hash table of size N=11, where the hash function is hash(key) = key mod N and quadratic probing is used to resolve collisions, after the following elements are inserted: 20, 42, 45, 49, 62, 72, 95. The probes are based on this equation: (H+c1∗i+c2∗i2)mod(N) and c1=1, c2=1. #4 [1 point] If direct hashing was used to store the same elements as the previous problems (20, 42, 45, 49, 62, 72, 95), what should be the minimum size of the hash table? ...
Purchase answer to see full attachment
Student has agreed that all tutoring, explanations, and answers provided by the tutor will be used to help in the learning process and in accordance with Studypool's honor code & terms of service.

Final Answer

Attached.

CPSC 131 Homework 10
#1 [3 points]
Sketch a hash table of size N=11, where the hash function is hash(key) = key mod N and chaining is
used to resolve collisions, after the following elements are inserted:
20, 42, 45, 49, 62, 72, 95
sing chaining:
---------------0
->
1
-> 45
2
->
3
->
4
->
5
-> 49
6
-> 72
7
-> 62, 95
8
->
9
-> 20, 42
10
->

Index

0

Value

1

2

45

3

4

5
49

6

7

72 62, 95

8

9

10

20,42

#2 [3 points]
Sketch a hash table of size N=11, where the hash function is hash(key) = key mod N and linear
probing is used to resolve collisions, after the following elements are inserted:
20, 42, 45, 49, 62, 72, 95
The H...

DrLicklider (250)
University of Maryland

Anonymous
The tutor managed to follow the requirements for my assignment and helped me understand the concepts on it.

Anonymous
The tutor was knowledgeable, will be using the service again.

Anonymous
Awesome quality of the tutor. They were helpful and accommodating given my needs.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4
Similar Questions
Related Tags