# Quicksort Multiple choice Questions and Answers (MCQs)

## Quicksort Multiple choice Questions and Answers (MCQs)

 Question 1
Quick sort is a .....
 A greedy algorithm B divide and conquer algorithm C dynamic programming algorithm D backtracking algorithm
Question 1 Explanation:
Quick sort is a divide and conquer algorithm. Quick sort first partitions a large array into two smaller sub-arrays. And then recursively sorts the sub-arrays.

 Question 2
What is the worst case time complexity of the Quick sort?
 A O(nlogn) B O(n) C O(n3) D O(n2)
Question 2 Explanation:
The worst case running time for Quick sort is O(n2). In Quick sort, the worst case behaviour occurs when the partitioning routine produces two sub-arrays one with n - 1 element and other with 0 elements.

 Question 3
Apply Quick sort on a given sequence 7 11 14 6 9 4 3 12. What is the sequence after first phase, pivot is first element?
 A 6 4 3 7 11 9 14 12 B 6 3 4 7 9 14 11 12 C 7 6 14 11 9 4 3 12 D 7 6 4 3 9 14 11 12
English grammar Questions answers
Question 3 Explanation:
Let's apply Quick sort on the given sequence,

For first phase, pivot = 7

7 11 14 6 9 4 3 12

i j

7 11 14 6 9 4 3 12

i j

7 3 14 6 9 4 11 12

i j

7 3 4 6 9 14 11 12

i j

7 3 4 6 9 14 11 12

j i

6 3 4 7 9 14 11 12

 Question 4
The best case behaviour occurs for quick sort is, if partition splits the array of size n into .....
 A n/2 : (n/2) - 1 B n/2 : n/3 C n/4 : 3n/2 D n/4 : 3n/4