7. [15 points] A hash table of length 10 uses open addressing with hash function h(k)=k mod 10, and linear probing. After inserting 6 values into an empty hash table, the table is as shown below. 0 1 2 42 3 23 4 34 5 52 6 46 7 33 8 9
Added by Jose Ramon W.
Close
Step 1
Indices: 2: h(2) = 2 mod 10 = 2 1: h(1) = 1 mod 10 = 1 34: h(34) = 34 mod 10 = 4 52: h(52) = 52 mod 10 = 2 (collision with 2, so we use linear probing and place it at the next available index, which is 3) 46: h(46) = 46 mod 10 = 6 33: h(33) = 33 mod 10 = 3 Show more…
Show all steps
Your feedback will help us improve your experience
Varun Indurthi and 101 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
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.
Given the following input: 4322, 1334, 1471, 9679, 1989, 6171, 6173, and 4199, and the hash function x mod 10, which of the following statements are true? i. 9679, 1989, 4199 hash to the same value. ii. 1471, 6171 hash to the same value. iii. All elements hash to the same value. iv. Each element hashes to a different value.
Adi S.
The table below shows the input, w, and output, k, for a linear function k. w | k -10 | 33 4.5 | -24 69.5 | | -47 a. Fill in the missing values of the table. b. Write the linear function k, round to 3 decimal places. k(w) = w +
William F.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD