Consider a hash table of size 11 that uses open addressing with linear probing, with h(k) = k mod 11. Records with keys 43, 36, 92, 87, 11, 47, 11, 13, 14 are inserted into an initially empty table with bins 0–10. What is the index of the bin into which the last record is inserted?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. 7
Explanation
43 → 10, 36 → 3, 92 → 4, 87 → 10 taken → 0, 11 → 0 taken → 1, 47 → 3, 4 taken → 5, 11 → 0, 1 taken → 2, 13 → 2…5 taken → 6, 14 → 3…6 taken → 7.More Data Structures and Algorithms questions
- Consider the traversals of a tree: Preorder → ABCEIFJDGHKL Inorder → EICFJBGDKHLA Which of the following is the correct postorder traversal?
- How many rotations are required during the construction of an AVL tree if the following elements are inserted in the given sequence? 35, 50…
- Consider the following undirected graph with vertices a, b, c, f, g, h and edges: a–b, a–c, a–f, b–c, b–f, b–h, c–g, f–g, f–h, g–h The foll…
- Consider the following algorithms and their running times. Which one of the following is correct?List I List II A. Breadth-first search I.…
- Consider the following statements on approximation algorithms: Statement I: APPROX-VERTEX-COVER is a polynomial-time 2-approximation algori…
- Which of the following is used to determine the cost performance index?