Which of the following is a divide-and-conquer algorithm?
2023
Which of the following is a divide-and-conquer algorithm?
- A.
Merge sort
- B.
Heap sort
- C.
Bubble sort
- D.
More than one of the above
- E.
None of the above
Attempted by 912 students.
Show answer & explanation
Correct answer: A
Divide-and-conquer is an algorithmic paradigm where a problem is broken into smaller subproblems, solved recursively, and then combined to form the final solution. Step 1: Merge sort divides the array into two halves, sorts each half recursively, and merges the sorted halves. This matches the divide-and-conquer approach. Step 2: Heap sort builds a heap and repeatedly removes the root element. It does not divide the input into subproblems, so it is not divide-and-conquer. Step 3: Bubble sort compares adjacent elements and swaps them. It operates iteratively without recursion or division, so it is not divide-and-conquer. Step 4: Since only merge sort fits the divide-and-conquer model, options claiming more than one or none are incorrect.