Searching Sorting and Hashing questions — page 2 of 2

Q40

GATE CS 2014 CS-3Searching Sorting and HashingMCQ2 marks−2/3 if wrong
Consider a hash table with 100 slots. Collisions are resolved using chaining. Assuming simple uniform hashing, what is the probability that the first 3 slots are unfilled after the first 3 insertions?
Show answer without attempting

Answer: A

Q14

GATE CS 2014 CS-1Searching Sorting and HashingMCQ1 mark−1/3 if wrong
Let PP be a quicksort program to sort numbers in ascending order using the first element as the pivot. Let t1t_1 and t2t_2 be the number of comparisons made by PP for the inputs [1  2  3  4  5][1\;2\;3\;4\;5] and [4  1  5  3  2][4\;1\;5\;3\;2] respectively. Which one of the following holds?
Show answer without attempting

Answer: C

Q39

GATE CS 2014 CS-1Searching Sorting and HashingNAT2 marks
The minimum number of comparisons required to find the minimum and the maximum of 100 numbers is _________________.
Show answer without attempting

Answer: 147.1 to 148.1

Q40

GATE CS 2014 CS-1Searching Sorting and HashingMCQ2 marks−2/3 if wrong
Consider a hash table with 9 slots. The hash function is h(k)=k mod 9h(k) = k \text{ mod } 9. The collisions are resolved by chaining. The following 9 keys are inserted in the order: 5, 28, 19, 15, 20, 33, 12, 17, 10. The maximum, minimum, and average chain lengths in the hash table, respectively, are
Show answer without attempting

Answer: A

Q6

GATE CS 2013 CSSearching Sorting and HashingMCQ1 mark−1/3 if wrong
Which one of the following is the tightest upper bound that represents the number of swaps required to sort nn numbers using selection sort?
Show answer without attempting

Answer: B

Q30

GATE CS 2013 CSSearching Sorting and HashingMCQ2 marks−2/3 if wrong
The number of elements that can be sorted in Θ(log⁡n)\Theta(\log n) time using heap sort is
Show answer without attempting

Answer: C

Q39

GATE CS 2012 CSSearching Sorting and HashingMCQ2 marks−2/3 if wrong
A list of nn strings, each of length nn, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is
Show answer without attempting

Answer: Marks to all

0/70 correct0 marks

Related topics in Algorithms