Merge Sort is an example of which algorithm design paradigm?
Options
- A. Greedy
- B. Divide and Conquer
- C. Dynamic Programming
- D. More than one of the above
- E. None of the above
B. Divide and Conquer
Merge Sort follows the Divide and Conquer algorithm design paradigm. This approach works in three main steps:
Divide
The array is divided into two halves recursively until each sub-array has only one element.
Conquer
Each sub-array is sorted individually. Since a single element is already sorted, the recursion stops.
Combine (Merge)
The sorted sub-arrays are merged together to form a fully sorted array.
If the array is:[8, 3, 5, 2]
Step 1: Divide
[8,3,5,2]
→ [8,3] [5,2]
→ [8] [3] [5] [2]
Step 2: Conquer (already sorted single elements)
Step 3: Merge
[8] [3] → [3,8]
[5] [2] → [2,5]
[3,8] [2,5] → [2,3,5,8]
Attempt Quiz Now:
BPSC Tre 4.0 DSA Practice Set