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

Correct Answer (Detailed Explanation is Below)

B. Divide and Conquer

Detailed Explanation

Explanation

Merge Sort follows the Divide and Conquer algorithm design paradigm. This approach works in three main steps:

  1. Divide
    The array is divided into two halves recursively until each sub-array has only one element.

  2. Conquer
    Each sub-array is sorted individually. Since a single element is already sorted, the recursion stops.

  3. Combine (Merge)
    The sorted sub-arrays are merged together to form a fully sorted array.

Example

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]
OOps! You are currently offline.