Searching Sorting and Hashing questions

Q14

GATE CS 2014 CS-3Searching Sorting and HashingMCQ1 mark−1/3 if wrong
You have an array of nn elements. Suppose you implement quicksort by always choosing the central element of the array as the pivot. Then the tightest upper bound for the worst case performance is
Show answer without attempting

Answer: A

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

0/50 correct0 marks

Related topics in Algorithms