Computer Science EngineeringHard
A table of size 7 uses h(k) = k mod 7 with linear probing. After inserting 15, 22, 8 and 1 in that order, at which index does key 1 reside?
- A. 4
- B. 3
- C. 5
- D. 2
Correct answer: A. 4
All four keys hash to 1, so they occupy indices 1, 2, 3 and 4 in order of insertion.
Practise more Algorithms, Data Structures & Programming (ISRO CS) questionsAlgorithms, Data Structures & Programming (ISRO CS): notes and key points
More Algorithms, Data Structures & Programming (ISRO CS) questions
- The Bellman-Ford single-source shortest path algorithm has running time
- What is the Theta bound of: for(i=1;i<=n;i++) for(j=i;j<=n;j+=i) count++;
- The recurrence T(n) = 4T(n/2) + n^2 has solution
- The time complexity of topological sorting of a DAG with V vertices and E edges using DFS is
- Which of the following standard sorting algorithms is stable?
- In a max-heap, the largest element is always located at