2. At what position will the key 60 be stored in the hash table using h(k) above if quadratic probing is used to resolve collisions, where c1 = 1, and c2 = 2? (i) 5 (ii) 6 (iii) 15 (iv) 12
Added by Stephen W.
Close
Step 1
Step 1: Using the given hash function h(k) = k mod 11, we can calculate the initial position of the key 60 as h(60) = 60 mod 11 = 5. Show more…
Show all steps
Your feedback will help us improve your experience
Sri K and 59 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Suppose that a hash table contains hash_size = 13 entries indexed from 0 through 12 and that the following keys are to be mapped into the table: 10 100 32 45 58 126 400 (a) Assume that the hash table uses "key % hash_size" as the hash function and that linear probing is used, present the content of the hash table using the following table. Also answer how many collisions occur when these keys are inserted into the table. (10 pts) (b) Assume that the hash table uses "key % hash_size" as the hash function and that quadratic probing is used, present the content of the hash table using the following table. Also answer how many collisions occur when these keys are inserted into the table. (10 pts) (c) Assume that the hash table uses "(sum of all digits of the key) % hash_size" as the hash function and that quadratic probing is used, present the content of the hash table using the following table. Also answer how many collisions occur when these keys are inserted into the table. (10 pts)
Sri K.
Consider the following values: 24, 71, 12, 11, 41, 17, 35 store the values in hash table as an array of eight positions using the division method for hashing and the linear probing method for resolving collisions. List all elements in hashtable corresponding to the indices below [0]________ [1]________ [2]________ [3]_______ [4]_________ [5]_________ [6]_________ [7]__________
Qudsiya A.
Some hash functions do not work as well as theoretically possible. Assume that we use the hash function on integer key i defined by h(i) = i2 mod B What is wrong with this hash function if B = 10? How good is this hash function if B = 16 ? Are there values of B for which this hash function is useful ?
Akash M.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD