Quicksort using Random Sampling Multiple choice Questions and Answers (MCQs)

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<

Quicksort using Random Sampling Multiple choice Questions and Answers (MCQs)

Question 1
Quick sort uses which of the following algorithm to implement sorting?
A
backtracking
B
greedy algorithm
C
divide and conquer
D
dynamic programming
Reasoning Questions answers
Question 1 Explanation: 
Quick sort uses the technique of divide and conquer in order to sort a given array. It divides the array into two parts about the pivot and then apply a quick sort to both the parts.

Question 2
What is a randomized quick sort?
A
quick sort with random partitions
B
quick sort with random choice of pivot
C
quick sort with random output
D
quick sort with random input
Economics Questions answers
Question 2 Explanation: 
Randomized quick sort chooses a random element as a pivot. It is done so as to avoid the worst case of quick sort in which the input array is already sorted.

Question 3
What is the purpose of using randomized quick sort over standard quick sort?
A
so as to avoid worst case time complexity
B
so as to avoid worst case space complexity
C
to improve accuracy of output
D
to improve average case time complexity
EVS Questions answers
Question 3 Explanation: 
Randomized quick sort helps in avoiding the worst case time complexity of O(n2) which occurs in case when the input array is already sorted. However the average case and best case time complexities remain unaltered.

Question 4
What is the auxiliary space complexity of randomized quick sort?
A
O(1)
B
O(n)
C
O(log n)
D
O(n log n)
GK Questions answers
Question 4 Explanation: 
Auxiliary space complexity of randomized quick sort is O(log n) which is used for storing call stack formed due to recursion. Note that the algorithms with space complexity as O(log n) also qualifies as in place algorithms as the value of log n is close to 1.

Question 5
What is the average time complexity of randomized quick sort?
A
O(n log n)
B
O(n2)
C
O(n2 log n)
D
O(n log n2)
Education Questions answers
Question 5 Explanation: 
The average case time complexity of randomized quick sort is same as that of standard quick sort as randomized quick sort only helps in preventing the worst case. It is equal to O(n log n).

There are 5 questions to complete.

 

 Download all FREE PDF Ebook >>>CLICK HERE<<<