πŸ“’ Too many exams? Don’t know which one suits you best? Book Your Free Expert πŸ‘‰ call Now!

  • google app store apple app store
  • βœ–

      Question

      Which sorting algorithm uses the 'Divide and Conquer'

      strategy and what is its recurrence relation?
      A Bubble Sort β€” T(n) = T(nβˆ’1) + O(n) Correct Answer Incorrect Answer
      B Insertion Sort β€” T(n) = T(nβˆ’1) + O(1) Correct Answer Incorrect Answer
      C Merge Sort β€” T(n) = 2T(n/2) + O(n), solving to O(n log n) Correct Answer Incorrect Answer
      D Selection Sort β€” T(n) = T(nβˆ’1) + O(n) Correct Answer Incorrect Answer
      E Counting Sort β€” T(n) = O(n+k) with no recurrence relation Correct Answer Incorrect Answer

      Solution

      Merge Sort applies Divide and Conquer in three phases: Divide: Split array into two halves recursively until subarrays of size 1 (base case β€” already sorted). Conquer: Recursively sort each half. Combine: Merge two sorted halves into one sorted array in O(n) time. Recurrence relation: T(n) = 2T(n/2) + O(n) β€” two recursive calls on n/2 elements each, plus O(n) merge step. Solved using Master Theorem (Case 2): T(n) = O(n log n).

      Practice Next

      Relevant for Exams:

      ask-question