GATE Computer ScienceHardNIELIT Scientist B
Keys 41, 22, 8, 30, 19, 52, 33, 63 are inserted in this order into an empty table of size 11 with h(k) = k mod 11 and linear probing. How many slot examinations (the final empty slot included) are made in total over all insertions?
- A. 28
- B. 32
- C. 33
- D. 30
Correct answer: D. 30
Counting the home slot and every further probe for the 8 insertions gives 30 examinations.
More Algorithms questions
- What is the length of the longest strictly increasing subsequence of [10, 22, 9, 33, 21, 50, 41, 60, 80, 3, 5, 70, 75, 90]?
- A directed graph on vertices 0–4 has edges 0→1 (3), 0→3 (7), 1→0 (8), 1→2 (2), 2→0 (5), 2→3 (1), 3→0 (2), 3→4 (4), 4→2 (3). What is the…
- A directed graph on vertices 0–9 has edges 0→1, 1→2, 2→0, 2→3, 3→4, 4→5, 5→3, 5→6, 6→7, 7→6, 8→7, 8→9, 9→8. How many strongly connected…
- In how many ways can an amount of 30 be paid using unlimited coins of denominations 1, 3, 5 and 7, where the order of coins does not matter?
- The keys 5, 3, 8, 1, 9, 2, 7, 10, 6, 4 are inserted one at a time into an initially empty max-heap (array-based, sift-up after each…
- How many different arrays of the distinct keys 1, 2, …, 10 are valid max-heaps (complete binary tree, parent larger than both children)?