Hashing Lab 1. Given the following key values, show what the data structures would look like after insertions 27 53 13 10 138 109 49 174 26 24 (no preprocessing necessary: pk = key) Bucket hashing of 10 elements (N=10) ip = (pk) % N a. Linear array of 10 elements using division а. hashing and the linear-quotient collision path algorithm N= 13, 4k+3 prime = 19 Array: Array: 1 LQHashing: 1. ip = pk % N 2. q-pk/N if (q%N != 0) offset = q 1 3 3 4 4 else 7 offset = 4k+3 prime 7 3. While collisions: 8 9 9 ip' = (ip + offset) % N 4. Set Array[ip]=key 10 11 12

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

please java thank you 

Hashing Lab
1. Given the following key values, show what the data structures would look like after insertions
27 53 13 10 138 109 49 174 26 24
(no preprocessing necessary: pk = key)
Bucket hashing of 10 elements
(N=10) ip = (pk) % N
Linear array of 10 elements using division
hashing
and the linear-quotient collision path algorithm
N= 13, 4k+3 prime = 19
а.
а.
Array:
Array:
||
1
LQHashing:
1. ip = pk % N
2. q=pk/N
if (q%N != 0)
offset = q
1
2
2
3
3
4
4
else
offset = 4k+3 prime
7
3. While collisions:
8
ip' = (ip + offset) % N
4. Set Array[ip]=key
10
11
12
679
Transcribed Image Text:Hashing Lab 1. Given the following key values, show what the data structures would look like after insertions 27 53 13 10 138 109 49 174 26 24 (no preprocessing necessary: pk = key) Bucket hashing of 10 elements (N=10) ip = (pk) % N Linear array of 10 elements using division hashing and the linear-quotient collision path algorithm N= 13, 4k+3 prime = 19 а. а. Array: Array: || 1 LQHashing: 1. ip = pk % N 2. q=pk/N if (q%N != 0) offset = q 1 2 2 3 3 4 4 else offset = 4k+3 prime 7 3. While collisions: 8 ip' = (ip + offset) % N 4. Set Array[ip]=key 10 11 12 679
2. Fill in the table based on exercise 1
Number of comparisons to retrieve this element
Key
Linear array -
Buckets -
(# of elements
(Length of
Collision Path
in linked list
+1)
compared)
53
138
109
49
174
26
Transcribed Image Text:2. Fill in the table based on exercise 1 Number of comparisons to retrieve this element Key Linear array - Buckets - (# of elements (Length of Collision Path in linked list +1) compared) 53 138 109 49 174 26
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education