Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
11th Edition
ISBN: 9780134670942
Author: Y. Daniel Liang
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 27.4, Problem 27.4.5CP
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.
Quadratic Probing:
- Quadratic probing is one other variation of open addressing.
- It is introduced to avoid the clustering problem in linear probing.
- Quadratic probing will look at the cells at indices (k + j2) % n, for j ≥ 0, i.e., k, (k + 1) % n, (k + 4) % n, (k + 9) % n, ..., and so on.
- Starting from the initial index, quadratic probing will add an increment of 2 to k to define a search sequence.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Using quadratic probing, create a hash table HT[0..8, 0..2] for the collection of keys 17, 9, 34, 56, 11, 4, 71, 86, 55, 10, 39, 49, 52, 82, 31, 13, 22, 35, 44, 20, 60, and 28.Use the hashing formula H(X) = X mod 9. What conclusions have you drawn?
Using double hasing, insert the following keys: {333, 335, 123, 617, 93, 63, 17, 37} into a hash table of size 17 using k mod m as h1(k), and h2(k) = 8 - k mod 8 as the offset.
Suppose we have a hash table of size 11 and use the hash function h(key) = (key + i2) % 11, where i = 0, 12, 22, ..., 102. After inserting entries with keys 35, 29, 54, 43, 121, 33, 44, and 187. What is the index of key 187?
index = {0, 1, 2, ..., 10}
Chapter 27 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)
Ch. 27.2 - Prob. 27.2.1CPCh. 27.3 - Prob. 27.3.1CPCh. 27.3 - Prob. 27.3.2CPCh. 27.3 - Prob. 27.3.3CPCh. 27.3 - Prob. 27.3.4CPCh. 27.3 - Prob. 27.3.5CPCh. 27.3 - Prob. 27.3.6CPCh. 27.3 - If N is an integer power of the power of 2, is N /...Ch. 27.3 - Prob. 27.3.8CPCh. 27.3 - Prob. 27.3.9CP
Ch. 27.4 - Prob. 27.4.1CPCh. 27.4 - Prob. 27.4.2CPCh. 27.4 - Prob. 27.4.3CPCh. 27.4 - Prob. 27.4.4CPCh. 27.4 - Prob. 27.4.5CPCh. 27.4 - Prob. 27.4.6CPCh. 27.5 - Prob. 27.5.1CPCh. 27.6 - Prob. 27.6.1CPCh. 27.6 - Prob. 27.6.2CPCh. 27.6 - Prob. 27.6.3CPCh. 27.7 - Prob. 27.7.1CPCh. 27.7 - What are the integers resulted from 32 1, 32 2,...Ch. 27.7 - Prob. 27.7.3CPCh. 27.7 - Describe how the put(key, value) method is...Ch. 27.7 - Prob. 27.7.5CPCh. 27.7 - Show the output of the following code:...Ch. 27.7 - If x is a negative int value, will x (N 1) be...Ch. 27.8 - Prob. 27.8.1CPCh. 27.8 - Prob. 27.8.2CPCh. 27.8 - Can lines 100103 in Listing 27.4 be removed?Ch. 27.8 - Prob. 27.8.4CPCh. 27 - Prob. 27.1PECh. 27 - Prob. 27.2PECh. 27 - (Modify MyHashMap with duplicate keys) Modify...Ch. 27 - Prob. 27.6PECh. 27 - Prob. 27.7PECh. 27 - Prob. 27.8PECh. 27 - Prob. 27.10PECh. 27 - Prob. 27.11PECh. 27 - (setToList) Write the following method that...Ch. 27 - (The Date class) Design a class named Date that...Ch. 27 - (The Point class) Design a class named Point that...
Knowledge Booster
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
- For the set of keys {17, 9, 34, 56, 11, 4, 71, 86, 55, 10, 39, 49, 52, 82, 31, 13, 22,35, 44, 20, 60, 28} obtain a hash table HT[0..8, 0..2] following quadratic probing.Make use of the hash function H(X) = X mod 9. What are your observations?arrow_forwardSuppose that 50 keys are to be inserted into an initially empty hash table using quadratic probing. What should be the size of the hash table to guarantee that all the collisions are resolved?arrow_forwardLet us consider an empty hash table with 10 positions indexed from 0 to 9. Please illustrate the content of the hash table after inserting the elements 79, 8, 39, 48, 3, and 60 using(1) Quadratic Probing (2) Double hashing with h(k) = k%10 and h’(k)= 7-k%7arrow_forward
- Does a hash table of size m contain the same number of linked lists at all times? No matter how hard I attempt, I cannot identify the purpose of a hash function. Provide an example to illustrate your point.arrow_forwardShow what occurs when the keys 5, 28, 19, 15, 20, 33, 12, 17, and 10 are inserted into a hash table with collisions addressed by chaining. If the table has nine slots, then the hash function should be h.k/D k mod nine.arrow_forwardInsert the keys <13, 19, 35, 71, 31, 6, 23, 4> into hash table of size m=11 using linear probing hashing. Here, h(k, i) =((k mod m) + i) mod m, i=0,1,2,…. How many times you have to increment i to resolve collisions?arrow_forward
- For a n-bit hash function and m-bit messages, there are 2m-n (I,e; Two to the power m-n) messages per hash value. For example, m=1024 and n=128 there are 2 896 (two to the power 896) messages per hash value. Still. Why is it difficult to find hash collision?arrow_forwardConsider a Hash Table with 6 bins. Show the content of the Hash Table (that uses chaining to handle collisions) after the following numbers are inserted into the table in order: 0 1 6 7arrow_forwardIn simple uniform hashing, each key is assumed to have equal probability to map to any of the hashes in a given table of size m. Given an open-address table of size 100 and 2 random keys, what is the probability that they hash to the same value? What is the probability that they hash to different values? PLEASE give me a written paragraph answerarrow_forward
- The 9-entry hash table that results from using the hash function, h(i) = (2i+7) mod 9, to hash the keys 12, 5, 13, 4, 10, 19, 8, 3, and 28, assuming collisions are handled by linear probing as follows: 0 1 2 3 4 5 6 7 8 10 19 3 28 12 8 13 4 5 group answer choice a) True b) Falsearrow_forwardGiven the following keys {336,121,613, 93, 63, 17, 10, 53} for insertion into a hash table, and using a hash function h(k)= k mod m, m = 11, show the resulting:(i) Quadratic probing hash table(ii) Linear probing hash table(iii) Separate chaining hash tablearrow_forwardDoes a hash table of size m always have the same number of linked lists? I have been trying to make sense of the function of a hash function for hours, but I just can't seem to get it. Give an instance to demonstrate your point.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education