Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134670942
Author: Y. Daniel Liang
Publisher: PEARSON
bartleby

Concept explainers

Question
Book Icon
Chapter 27.4, Problem 27.4.6CP
Program Plan Intro

Open Addressing:

  • Open addressing is a method of finding an open location in the hash table at the time of collision.
  • There are several variations for open addressing such as linear probing, quadratic probing, and double hashing.

Double Hashing:

  • One other open addressing method that can avoid the clustering problem is referred as double hashing.
  • In order to avoid the clustering problem, double hashing method uses a secondary hash function on the keys to determine the increments.

Blurred answer
Students have asked these similar questions
3. Double hashing is one of the methods to resolve collision. Write a function to implement this method. The equations used in this method are given below. Note: implement everything within the double hash function. P = (P + INCREMENT(Key)) mod TABLE_SIZE INCREMENT(Key) = 1 + (Key mod INCR)
Insert keys {10, 22, 11, 31, 24, 88, 38, 21} into an empty hash table with CAPACITY = 10 using quadratic probing (c1=0 and c2=1) to resolve collision (You shouldn't use a for/while loop except to increment the value of i for quadratic probing). Use the hash function is h(k, i) = (h’(k) + c1* i + c2* i^2) mod 10 and h’(k) = k mod 10.
Draw a hash table given these numbers and hashing function, build each of the hashing options, and decide if it is efficient, and what function or size might be a better match. Explain why it is efficient or what changes you would make for it to be efficient. a. Scenario 1 a. Hashing function: k mod 4 b. Linear Probing c. Array from 0 to 3 d. Values: 19, 7, 12, 11 b. Scenario 2 a. Hashing function: k mod 10 b. Quadratic Probing c. Array from 0 to 9 d. Values: 20 39 23 56 34 29 55 13 c. Scenario 3 a. Hashing function: first three digits of a phone number b. Overflow chaining c. File with base address of 0 and ends at 999 d. Values: 3135552314, 7343455523, 3134445555, 3134441234, 7342346555, e. 5555342232, 4072984555, 2692185552 d. Scenario 4 a. Hashing function: k mod 100 b. Internal Chaining c. Array 0 to 99 d. Values: 314 325 623 2234 425 1234 2132 2361 1245 123 436 742
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education