Which of the following algorithm design approach is used in Quick sort…
2022
Which of the following algorithm design approach is used in Quick sort algorithm ?
- A.
Dynamic programming
- B.
Back Tracking
- C.
Divide and conquer
- D.
Greedy approach
Attempted by 793 students.
Show answer & explanation
Correct answer: C
Answer: Quicksort uses the divide and conquer approach.
How it applies:
Choose a pivot and partition the array into elements less than the pivot and elements greater than the pivot.
Recursively apply the same process to the left and right partitions.
After recursion finishes, the entire array is sorted (no separate merge step is required).
Why the other approaches do not apply (brief):
Dynamic programming: requires overlapping subproblems and memoization; quicksort divides into independent subproblems instead.
Backtracking: explores and abandons partial solutions under constraints; quicksort does not perform such search.
Greedy approach: makes locally optimal choices to build a solution; quicksort's partition-and-recurse pattern is not a greedy construction.
Complexity and characteristics:
Average time complexity: O(n log n).
Worst-case time complexity: O(n^2) (can be avoided with good pivot choice such as randomized pivot or median-of-three).
Space: typically O(log n) average due to recursion (in-place partitioning), though worst-case recursion depth can be O(n).
Stability: standard quicksort is not stable.
A video solution is available for this question — log in and enroll to watch it.