Prepare for the A Level Computer Science OCR Exam with comprehensive quizzes that cover essential topics, flashcards, and detailed explanations to help you excel. Ace your exam with confidence!

Practice this question and more.


What is the fundamental approach taken by Merge Sort?

  1. It divides the array into two halves and sorts them recursively

  2. It compares and swaps adjacent elements until sorted

  3. It stores each element in a global variable

  4. It collects all values into a single local scope

The correct answer is: It divides the array into two halves and sorts them recursively

Merge Sort employs a divide-and-conquer strategy as its fundamental approach. This means that it first splits the array into two halves, sorting each half recursively until the base case is reached, where each sub-array contains a single element. Since a single-element array is inherently sorted, the algorithm then proceeds to merge these sorted halves back together in a sorted manner. This two-step process of dividing and merging continues until the entire array is sorted. This method is efficient, with a time complexity of O(n log n), which makes it suitable for large datasets. The merging process ensures that the elements from the divided arrays are combined in a way that maintains order, contrasting with other sorting algorithms which may use simpler or less efficient methods.