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.3, Problem 4E
Program Plan Intro
Compute the locations to which the keys 61,62,63,64 and 65 are mapped.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
A linear probing hash table of length 10 uses the hash function h(x) = x mod 10 + 1. mod is the reminder operator. For example the h(42) = 42 mod 10 + 1 = 2 + 1 = 3 so we insert 42 in the position 3 in the array.
After inserting 6 integer keys into an initially empty hash table, the array of keys is…
The hash function
h(k)= [(m(kA mod 1)] for A = 2-³
is used to insert the keys 61, 62, 63, 64, and 65 into a hash table of size m = 1000.
The order of the hash codes in the table are given by
a. 625, 125, 0, 750, 875
b. 625, 750, 625, 125, 0
c. 625,125, 0, 875, 750
d. 625, 750, 875, 0, 125
e. 625, 750, 125, 875, 0
Suppose you have a hash table of size N = 64, and you are using quadratic probing with c1 = 1 and
c2 = 1. 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). What are the first 4 values in the search sequence (starting
with the home position) for a record with key k=1948?
Blank # 1
Blank # 2
Blank # 3
Blank # 4
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
- Does a hash table of size m always have the same number of linked lists? I've been trying to understand the function of a hash function, but I just can't seem to get it. Give a case study to demonstrate your point.arrow_forwardDoes 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_forwardGiven a hash table of size 9 with hash function x%9. Write the element order of the linear probe hash table when these keys are inserted in the given order. 1,20,11,28,25,9,18 Answer is just a sequence of elements in the same format. Use hypen - to indicate empty space. For example a table like below must be written as in the following: 11 28 9,28,-,11,1,-,- Cevap: Kalan Süre 1:37:31arrow_forward
- Implement a commonly used hash table in a program that handles collision using linear probing. Using (K mod 13) as the hash function, store the following elements in the table: {1, 5, 21, 26, 39, 14, 15, 16, 17, 18, 19, 20, 111, 145, 146}.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_forwardA hash table is a very important data structure in computer science. It is used for fast information retrieval. Itstores data as a < key, value > pair, where the value is indexed by the key. Note that keys must ne unique.Consider the example of storing persons name using the social security number (ssn) as the key. For eachssn x, a hash function h is used, where h(x) is the location to store the name of x. Once we have created atable, to look up the name for ssn x, we can recomputes h(x) and then look up what is stored in that location.In Python, dictionaries are based on hash tables. Typically, the hash function h is deterministic; we do notwant to get different results every time we compute h(x). But h is often chosen to be pseudo-random. Forthis problem, we will assume that h is truly random. Suppose there are k people, with each person’s namestored in a random location (independently), represented by an integer between 1 and n, k < n. It mayhappen that one location has…arrow_forward
- Consider a simple hash function as "key mod 8" and a sequence of keys as 75, 89, 42, 58, 94, 38, 32, 21. What will be the final sequence if you insert those keys in an array of size 8 using linear probe.arrow_forwardGiven a hash function: h(k) = ((A*k mod 2^w)) >> (w-r), where you are given a value of k and w. How do you make a list of integers that have the same hash value from this hash function? We also know that 2^(w-1)arrow_forward1. Given the following keys: 323, 156, 731, 125, 73, 200 The size of the hash table is 11 The hash function, h(k)= k mod m Use Quadratic Probing to resolve any collision, with constants C₁ = 1 and C₂ = 2 First compute the hash values using h(k) function and construct a table of k and h(k) as shown below: k H(K) 323 156 731 125 73 200 Show sample computations for h(k) Now construct a Hash Table of size 11 and place the keys (k) properly. Must give proper explanations and show computational details for each collision.arrow_forward
- hash tablearrow_forwardSuppose you have a hash table of size N = 256, and you are using double hashing. The keys in your hash are 4-digit integers (0000 through 9999) and your hash function is h(k) = (k²)%N The second hash function (used for probing) is h₂(k) = (sum-of-digits (k) * 8)%N What are the first 4 values in the search sequence (starting with the home position) for a record with key k-2025?arrow_forward2-A linear probing hash table of length 10 uses the hash function h(x) = x mod 10 + 1. mod is the reminder opertatro. For example the h(42) = 42 mod 10 + 1 = 2 + 1 = 3 so we insert 42 in t he position 3 in the array. After inserting 6 integer keys into an initially empty hash table, the array of keys is 1 2 3 4 5 7 8 9. 42 23 34 52 46 33 a- insert the key 35 b- insert the key 12 c- insert the key 10arrow_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