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
Question
Chapter 17.4, Problem 1E
Program Plan Intro
To argue that the dynamic implementation of insertion in open-address hash table runs at
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
1(c) What is the best-case time complexity for inserting n items into a hash table of size m? When willthe performance of an open addressing hash table degrade no matter what collision resolutionscheme is used?
Consider a hash table with m = 8 slots.
a) Show the result of inserting numbers 9, 12, 2, 43, 31, 25 using a hash function h(k) = [m(kA mod 1)] for A = √3/2 with collision resolution by chaining.
b) Show the results of inserting numbers 9, 12, 2, 43, 31, 25 using open addressing with auxiliary hash function h'(k) = [m(kA mod 1)] for A = √3/2 and linear probing. How many probes are needed in this open-addressing cache to determine that 38 isn't in the hash? Explain your answers.
Given an empty hash table of size 7 that uses open addressing, the following sequence of keys is to be inserted:
15 17 8 23 3 5
Insert these keys using each of the following approaches.
h(x) = x % 7; linear probing
0
1
2
3
4
5
6
2. h(x) = x % 7; quadratic probing
0
1
2
3
4
5
6
3.h(x) = x % 7; double hashing with stepSize = 5 - (x % 5);
0
1
2
3
4
5
6
Knowledge Booster
Similar questions
- Please do not get information from the internet. 4-) Assume we find the universal hashing which is the perfect hashing algorithm. Explain a) How is the performance of Rolling Hashing ADT affected? b) How is the performance of Karp-Rabin affected? c) How is the performance of chaining affected? d) How is the performance of open addressing affected?arrow_forwardQ. If suppose we've given a cache of length k = 3, an initial state {a, b, c}, and a known schedule of items needing to be cached, {b, e, d, a, c, b, e, a}, what will the state of the cache be after five steps if the farthest-in-future approach is used to determine which item to remove from the cache? a. {b, c, e}b. {b, d, a} c. {b, c, d} d. {c, d, a}{b,c,d} seems to be wrong answer. Could you help me with the correct one ?arrow_forwardConsider inserting the keys 10, 22, 31, 4, 15, 28, 17, 88, 59 into a hash table of length m = 11 using open addressing with the auxiliary hash function h'(k) = k. Illustrate the result of inserting these keys using linear probing, using quadratic probing with c1 = 1 and c2 = 3, and using double hashing with h1(k) = k and h2(k) = 1 + (k mod(m − 1)).arrow_forward
- Think about a hash table using open addressing. If there are N elements and the load factor should not go above 75%, what should the table size, S, be? Here you are not using a specific number for N, therefore you won't use my prime number table. Express your answer in the following format. Don't use any space. If you need to use greater/less than or equal to something, type >= or <=. S?arrow_forwardSuppose that a disk drive has 5,000 cylinders, numbered 0 to 4,999. The drive is currently serving a request at cylinder 2,150, and the previous request was at cylinder 1,805. The queue of pending requests, in FIFO order, is: 2,069, 1,212, 2,296, 2,800, 544, 1,618, 356, 1,523, 4,965, 3681 Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests for each of the following disk- scheduling algorithms? e. C-SCAN f. C-LOOKarrow_forwardSuppose Alice computes the Secret suffix MAC (page 322: secret suffix MAC(x) = h(x || key)) for the message ”GD” (in ASCII) with key " H”(in ASCII) that both Alice and Bob know. The hash function that is used is h(x1x2x3)= g(g(x1 XOR x2) XOR x3 ) where each xi is a character represented as 8 bits, and g(x) is a 8-bit string that is equal to the complement of bits in x. For example, g(10110011) = 01001100. The MAC is 8 bits. (8-bit ASCII representation of the characters is given below.) What is the Secret suffix MAC computed by Alice? Show the MAC as the single character. What information is sent by Alice to Bob.arrow_forward
- Given input {4371, 1323, 6173, 4199, 4344, 9679, 1989} and a hash function h(x) = x mod 10, show the resulting open addressing hash table: (ii) with second hash function h2(x) = 7 – (x mod 7). Please show me the stepsarrow_forwardFor hash functions, to avoid attacks based on the birthday paradox, it is required to have large number of output bits. Why are shorter length outputs used in MAC?arrow_forwardConsider a 4-way set associative vache mee up of 64-biy words.the number of words per line is 8 and the number of sets 4096 sets.what is the cache size?arrow_forward
- Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4,999. The drive is currently serving a request at cylinder 2,150, and the previous request was at cylinder 1,805. The queue of pending requests, in FIFO order, is: 2,069 1,212 2,296 2,800 544 1,618 356 1,523 4,956 3,681 Calculate the total seek time for each of the schedules TOTAL DISTANCE TOTAL SEEK TIME FCFS SSTF SCAN LOOK C-SCAN C-LOOKarrow_forwardTo put it another way, how does an entirely associative cache work?arrow_forwardThe paging problem arises from the limitation of finite space. Let's assume our cache C has k pages. Now we want to process a sequence of m page requests which must have been placed in the cache before they are processed. Of course if m<=k then we just put all elements in the cache and it will work, but usually is m>>k. There are two ways to approach this problem:offline and online solve using both approacharrow_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