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.5, Problem 1E
Program Plan Intro
To show that the probability of no collision is
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Consider a linear hash table that uses 4-bit hash keys and stores two records per bucket. The capacity threshold is 75%; that is, we create a new bucket whenever the number of records is more than 3/2 the current number of buckets. Simulate the insertion, into an initially empty hash table, of records with (hash values of) keys 1111, 1110, 1101,..., 0001, 0000, in that order. Which of the following keys never appears alone in a bucket at any time during the insertion sequence?
a) 1110
b) 1011
c) 0100
d) 1001
Hey, Given is a hash table with an initial size of 1000 and a hash function that ensures ahashing, where the keys are chosen randomly under the uniformity assumption.me are chosen. After how many insertions do you have to expect a collision probability of more than 80%?of more than 80%?To keep the number of collisions low during hashing, one can reduce the size of the has-hash table after a certain number of insertions. After which number n of inserted elements must the table be increased for the first time, if no collision occurred in the previous n - 1 elements and the probability of a collision in the n-th insertion should be less than 20%?
Suppose that the following keys are inserted into an initially empty linear-probing hash table,
but not necessarily in the order given,
key
hash
A
1
D
N
1
4
and it result in the following hash table:
1
3
4
6
M
A
D
L
Assuming that the initial size of the hash table was 7 and that it did not grow or shrink,
Choose the possible sequence of keys that could have been inserted.
O A, N, M, D, X, L, S
O , M, N, A, X, D, L
O X, D, L, S, M, N, A
O A, N, M, D, X, L, S
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
- P5arrow_forwardWhat is the average-case runtime required for a successful operation in a hash table using chaining where there are m buckets and n items in the hash table? Select one: a. O( n/m ) b. O(n) The answer depends on both n and m c. O( 1) d. O(m)arrow_forwardComputer Science (a) Let h be a collision resistant hash function. Now consider the following function H that is defined for binary strings of even length. Let x = x1||x2 with x1 ∈ F2n and x2 ∈ Fn2 . Then H(x) = h(x1 ⊕ x2). Prove that this function is not collision resistant.arrow_forward
- Suppose 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_forwardNonearrow_forwardSuppose you have a hash table of size N = 64, and you are using pseudo-random probing. The keys in your hash are 4-digit integers (0000 through 9999) and your hash function is h(k) = (the sum of the digits in k). Assume that the first 4 slots of your pseudo-random probing array contain: 5, 10, 60, 30 What are the first 4 values in the probe sequence (starting with the home position) for a record with key k=1948?arrow_forward
- Given a hash table of size M=10 and a linear probing method, following are the contents of the hash table: [-1, 41, 71, -1, 64, 75, 84, -1, 88, 9]. -1 indicates slot is empty. Use the standard hash function: h(x)=x%M Match the index on the left with the value on the right for the hash table after the following operations are carried out in the given order: delete(88) delete(41) delete(44) insert(108) insert(71)arrow_forward0 1 11592 2 4786 3 4 5 6 589 7 1794 For this problem the hash function h(k) is equal to the sum of the first and last digits of k, modulo 8. For example, if you are hashing the key 2476, then h(2476) = (2 + 6) % 8 = 0 Assume that collision resolution is done by linear probing. In what slot will 1000 be placed? Provide only the index of the slot.arrow_forwardSuppose you have a hash table of size N = 64, and you are using quadratic probing. The keys in your hash are 4-digit integers (0000 through 9999) and your hash function is h(k) = (the sum of the digits in k). Assuming keys are uniformly random over the range 0000 to 9999, is this a good hash function? (Answer true for yes, false for no). True Falsearrow_forward
- 1.Question: Consider a hash table of size m=7. Draw the table that results after inserting the following keys: 19, 26, 13, 48 and 17 for each case: a. collision resolved with chaining, with hash function h(k)=k%7 b. collision resolved by linear probing, with hash function h1(k,i)=[h(k)+i] % 7 (i=0,1,..,m-1) c. collision resolved by quadratic probing, with hash function h1(k,i)=[h(k)+i²] % 7 (i=0,1,..,m-1) d. collisions resolved by double hashing, with h2(k,i)=[h(k)+i*{5-(k%5)}]%7 (i=0,1,..,m-1)arrow_forwardGiven:• a hash function: h(x) = | 3x + 1 | mod M• bucket array of capacity 'N'• set of objects with the folloeing keys: 12, 44, 13, 88, 23, 94, 11, 39, 20, 16, 5 (to input from left to right) 1. What would be the hash table where M=N=11 and collisions are taken care of using linear probing? 2. What would be the hash table where M=N=11 and collisions are taken care of using separate chaining? 3. Would a size N for the bucket array be able to exist, so that no collisions happen with thehash function h(x) = | 2x + 5 | mod 11 and the keys above?arrow_forward1. Consider an open hash (that is, one that deals with collisions by using a linked list) with a million entries. The hash algorithm takes 200ns to run, each comparison of objects takes 10ns, and everything else involved in the lookup takes trivial time. How large does the hash table need to be to use less time on chained comparisons than on the initial hash lookup? (Remember that you always have to compare once.)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