EBK DATA STRUCTURES AND ALGORITHMS IN C
4th Edition
ISBN: 9781285415017
Author: DROZDEK
Publisher: YUZU
expand_more
expand_more
format_list_bulleted
Concept explainers
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Draw a hash table given these numbers and hashing function, build each of the hashing
options, and decide if it is efficient, and what function or size might be a better match. Explain
why it is efficient or what changes you would make for it to be efficient.
a. Scenario 1
a. Hashing function: k mod 4
b. Linear Probing
c. Array from 0 to 3
d. Values: 19, 7, 12, 11
b. Scenario 2
a. Hashing function: k mod 10
b. Quadratic Probing
c. Array from 0 to 9
d. Values: 20 39 23 56 34 29 55 13
c. Scenario 3
a. Hashing function: first three digits of a phone number
b. Overflow chaining
c. File with base address of 0 and ends at 999
d. Values: 3135552314, 7343455523, 3134445555, 3134441234, 7342346555,
e. 5555342232, 4072984555, 2692185552
d. Scenario 4
a. Hashing function: k mod 100
b. Internal Chaining
c. Array 0 to 99
d. Values: 314 325 623 2234 425 1234 2132 2361 1245 123 436 742
4.
Given input keys of a file 130, 60, 98, 28, 38, 55 and a hash function with
table-size=10. Show the results of double hash with
Hash (key) = key%10 and Hash2( key ) = P- (key mod P)
%3D
Draw the contents of the hash table given the following conditions:
The size of the hash table is 25.
• Linear Probing is used to resolve collisions.
• The hash function H(k) should be calculated in the following way where k is the element
to be hashed:
R(k) = k mod (summation of last two digits of your student id + 7)
If R(k)<10
H(k)=R(k) + 8
else
H(k)=R(k) - 4
What values will be in the hash table after the following sequence of insertions?
55, 65, 8, 18, 20, 11, 56, 27, 15, 167
[Note: Draw the values using a hash table and show your work for partial credit.]
Chapter 10 Solutions
EBK DATA STRUCTURES AND ALGORITHMS IN C
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
- Given input keys of a file 130, 60, 98, 28, 38, 55 and a hash function with table-size=10. Show the results of:a). Hashing with open-addressing using linear probingb). Hashing with Chainingarrow_forward4. In the extensible hash index (each bucket can hold at most 2 items) below, if we want to insert 19, what will be the structure of the hash index after the insertion? 16 20 A h(1) = 00001 h(2) = 00010 h(3) = 00011 h(7) = 00111 h(16) = 10000 h(18) = 10010 h(19) = 10011 h(20) = 10100 00 01 1 B 10 11 Directory 3 D %3D Buckets 5. Assuming that the node capacity of B*-trees is 4, please draw the updated B*- trees upon insertions. L 5(a). Insert tuples with key 23* into the following B*-tree. Root 14 19 24 33 2* 3* 5* 7* 14* 16* 19* 20* 22* 24*| 27* 29* 33* 34* 38* | 39*arrow_forwardAssume you have a text file containing 10,000 words and you want to count the frequency of each word in the file. What is the time complexity of this operation using a hash table?arrow_forward
- Which of these is NOT a characteristic of a secure hash algorithm? a. Collisions should be rare. b. A message cannot be produced from a predefined hash. c. The results of a hash function should not be reversed. d. The hash should always be the same fixed size.arrow_forwardb) Given the input keys {42,39,57,3,18,5,67,13,70, 26}, and a fixed table size of 13, and a hash-function H(X) = X mod 13, show the resulting "Separate chaining hash-table". Show your work step by step. On the created hash-table, apply a search for the key 68 and show the results.arrow_forwardA hash function h defined h(key)=key % 7 is used to insert the keys 44, 45, 79, 55, 91, 19 into a table indexed from 0 to 7 (that is, HT(0], HT [1],HT[2],HT[3],HT[4],HT[5], HT[6], HT[7] ). Show the how these keys, in the order given, are inserted in HT using the above hashing function when collisions are handled by 1) a linear probing, and 2) double hashing using a second hash function g(k)=5 - (key%5). The double hashing rule is (h(X) + i*g (X)) % HTSize, i=0,1,2,..). Note that some keys (44, 45, 55 ) are already inserted. You need to insert the keys, 79,91, 19 into the hash table. Index Linear Probing to resolve collision Double Hahing to resolve collision (a) (f) (g) 1 (b) 44 44 3 45 45 4. (c) (h) (i) (d) 6 55 55 (e) (i)arrow_forward
- I am having troubles understanding part 4: hash table with second hash· function h2 = 7 - (x mod 7). What calculations do I have to go to insert the keys in the table? What do I have to do with this second function given?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_forwardCollisions can be reduced by choosing a hash function randomly in a way that is independent of the keys that are actually to be stored. A. False B. Truearrow_forward
- Given the array of size 13, and the hashing function h(x) = x%13, at which array location would data with key value 33 be stored? Assuming 45 and 71 have already been inserted in the array and the quadratic probing is used for collision. Question options: A. 7 B. 10 C. 9 D. 2 E. 11arrow_forwardDraw the contents of the hash table given the following conditions: • The size of the hash table is 18. • Linear Probing is used to resolve collisions. • The hash function H(k) should be calculated in the following way where k is the element to be hashed: R(k) = k mod (summation of last two digits of your student id) If R(k)<10 H(k)=R(k)+8 else H(k)=R(k)-2 What values will be in the hash table after the following sequence of insertions? 35, 18, 8, 13, 11, 49, 16, 27 [Note: Draw the values using a hash table and show your work for partial credit.]arrow_forwardA hash function h defined as h[k]=k mod 10, with linear probing is used to store the following keys 44,45,79,55,91,18,63 and 11. What will be location of the last record?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