GATE Computer ScienceHardGATE CSE
Keys 22, 33, 44, 12, 23, 34, 45, 1 are inserted in this order into a table of size 11 using h(k) = k mod 11 with linear probing. Counting every slot examined (occupied ones and the final empty one), how many probes are made in total?
- A. 31
- B. 27
- C. 34
- D. 8
Correct answer: A. 31
Insert probes in order: 1, 2, 3, 3, 4, 5, 6, 7 = 31.
More Algorithms questions
- A DAG on vertices 0..5 has edges 0→2, 1→2, 1→3, 2→4, 3→4, 3→5, 4→5. How many distinct topological orderings does it have?
- A binary search (loop while low ≤ high, mid = ⌊(low+high)/2⌋) runs on a sorted array of 1000 elements. The maximum number of loop…
- Keys 1..7 are inserted into an initially empty BST (no balancing) in some order. For how many of the 7! insertion orders does the…
- Keys 1..8 are inserted into an empty BST in each of the 8! possible orders. In how many orders is the resulting tree a single path (height…
- For X = "ABCBDAB" and Y = "BDCABA", how many DISTINCT strings are longest common subsequences of X and Y?
- An undirected weighted graph on vertices 0..6 has edges, written (u, v, weight): (0,1,2), (0,2,2), (1,2,2), (1,3,3), (2,3,3), (3,4,1)…