Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 11.2, Problem 1E
Program Plan Intro
To determine expected number of collisions hash n distinct keys into an array of length m.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Is it consistent to say that a hash table of size m always contains the same number of linked lists? I've been trying to understand the purpose of a hash function for ages. Give an illustration of your point with an example.
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.
Given is the hash function h(k) = k mod 10. How many different insertion sequences of keys are there to generate the following hash table if closed hashing
with linear probing is used?
B0 = ∅ B1 = ∅ B2 = {32} B3 = {43} B4 = {54} B5 = {12} B6 = {76} B7 = {23} B8 = ∅ B9 = ∅
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
- 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}arrow_forwardSuppose that keys are t-bit integers. For a modular hash function with prime M, prove that each key bit has the property that there exist two keys differing only in that bit that have different hash values.arrow_forwardSuppose we use a hash function h to hash n distinct keys into an array T oflength m. Assuming simple uniform hashing, what is the expected number ofcollisions? More precisely, what is the expected cardinality of ffk; lg W k ¤ l andh.k/ D h.l/g?arrow_forward
- Does a hash table of size m consistently contain the same number of linked lists? I am unable to identify the purpose of a hash function, no matter how hard I attempt. To demonstrate your thesis, provide an example.arrow_forwardFor 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_forwardAnswer the following questions for a hash table of size T storing n items: What are the main operations that a hash table supports and what is the average and worst time complexity, respectively, of each operation?arrow_forward
- Does a hash table of size m always have the same number of linked lists? I have been trying to understand the function of a hash function for hours, but I just can't seem to get it. Provide an instance to demonstrate your point.arrow_forwardIs there a predetermined limit to the number of linked lists that may be included inside a hash table of size m? Hash functions continue to baffle me, and I have no idea how to interpret their intended use. Give an example to explain the point you're making.arrow_forwardGive the contents of a linear-probing hash table that results when you insert thekeys E A S Y Q U T I O N in that order into an initially empty table of initial size M= 4 that is expanded with doubling whenever half full. Use the hash function 11 k % Mto transform the kth letter of the alphabet into a table index.arrow_forward
- 4 Suppose an adversary uses brute-force to attack hash functions. For a general hash function with m-bit hash value, how many times on average should an adversary try to find the preimage of a given hash value? How many times on average should an adversary try to find two preimages that generate the same hash value?arrow_forwardGiven input {4371, 1323, 6173, 4199, 4344, 9679, 1989} and a hashfunction h(x) = x mod 10, show the resulting:a. Separate chaining hash table.b. Hash table using linear probing.c. Hash table using quadratic probing.d. Hash table with second hash function h2(x) = 7 − (x mod 7).arrow_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_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