Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA Homework Q1.) What is the range of values computed by the hash function hash(x)= x % 100? A) 0 to 99 B) 0 to

JAVA Homework

Q1.) What is the range of values computed by the hash function hash(x)= x % 100?

A) 0 to 99

B) 0 to 100

C) 1 to 99

D) 1 to 100

Q2.) How are elements deleted in linear probing in the implementation discussed in the Weiss textbook?

A) the element referenced in that location is set to null.

B) the HashEntry referenced is made null

C) they are changed to zero

D) they are marked "deleted" or "available"

Q3.) Suppose we are implementing quadratic probing with a hash function hash(x) = x mod 100. If an element with key 4592 is inserted and the first four locations attempted are already occupied, then the next index location that will be tried is

A) 8

B) 1

C) 9

D) 95

Q4.) Linked lists are used in

A) double hashing

B) linear probing

C) quadratic probing

D) separate chaining

Q5.) Primary clustering occurs in

A) linear probing

B) quadratic probing

C) separate chaining

D) all of the above

Q 6.) Rehashing can be used in

A) linear probing

B) quadratic probing

C) separate chaining

D) all of the above

Q7.) Given the input {4371, 1323, 6173, 4199, 4344, 9679, 1989, 2525}, a fixed table size of 10, and a hsh function of H(X) = X % 10, show the result of inserting all of the elements using linear probing to resolve collisions. (Place null in the unused locations.)

Ans:

0 -------------------

1 -------------------

2 -------------------

3 -------------------

4 -------------------

5 -------------------

6 -------------------

7 -------------------

8 -------------------

9 -------------------

Q8) Given the input {4371, 1323, 6173, 4199, 4344, 9679, 1989, 2525}, a fixed table size of 10, and a hsh function of H(X) = X % 10, show the result of inserting all of the elements using quadratic probing to resolve collisions. (Place null in the unused locations.)

Ans:

0 -------------------

1 -------------------

2 -------------------

3 -------------------

4 -------------------

5 -------------------

6 -------------------

7 -------------------

8 -------------------

9 -------------------

Q9.) Given the input {4371, 1323, 6173, 4199, 4344, 9679, 1989, 2525}, a fixed table size of 10, and a hsh function of H(X) = X % 10, show the result of inserting all of the elementsusing separate chaining to resolve collisions.

(Place null in the unused locations. If multiple elements are in the same location, add to the front of the chain and separate elements with a comma and space. For example: 1234, 2234, 3334)

Ans:

0 -------------------

1 -------------------

2 -------------------

3 -------------------

4 -------------------

5 -------------------

6 -------------------

7 -------------------

8 -------------------

9 -------------------

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

ISBN: 1583474013, 978-1583474013

More Books

Students also viewed these Databases questions

Question

3. Review the evidence. Do you believe the testimony presented?

Answered: 1 week ago

Question

1. What are the marketing implications of this situation?

Answered: 1 week ago