Searching Sorting and Hashing questions

Q24

GATE CS 2026 CS-1Searching Sorting and HashingMSQ1 mark
Consider a hash table P[0,1,…,10]P[0, 1, \dots, 10] that is initially empty. The hash table is maintained using open addressing with linear probing. The hash function used is
h(x)=(x+7)(mod11)h(x) = (x + 7) \pmod{11}.

Consider the following sequence of insertions performed on PP:
1,13,22,15,11,241, 13, 22, 15, 11, 24

Which of the following positions in the hash table is/are empty after these insertions are performed?
More than one option can be correct.
Show answer without attempting

Answer: C

Q30

GATE CS 2026 CS-2Searching Sorting and HashingNAT1 mark
The keys 5, 28, 19, 15, 26, 33, 12, 17, 10 are inserted into a hash table using the hash function h(k)=k mod 9h(k) = k \bmod 9. The collisions are resolved by chaining. After all the keys are inserted, the length of the longest chain is __________. (answer in integer)
Show answer without attempting

Answer: 3

Q32

GATE CS 2026 CS-2Searching Sorting and HashingNAT1 mark
Consider an array A=[10,7,8,19,41,35,25,31]A = [10, 7, 8, 19, 41, 35, 25, 31]. Suppose the merge sort algorithm is executed on array AA to sort it in increasing order. The merge sort algorithm will carry out a total of 7 merge operations.

A merge operation on sorted left array LL and sorted right array RR is said to be void if the output of the merge operation is the elements of array LL followed by the elements of array RR.

The number of void merge operations among these 7 merge operations is __________. (answer in integer)
Show answer without attempting

Answer: 3

0/30 correct0 marks

Related topics in Algorithms