Prepare for the A Level Computer Science OCR Exam with engaging quizzes, detailed explanations, and effective study tips. Maximize your readiness and boost your confidence for exam day!

Practice this question and more.


What is the primary characteristic of the Insertion Sort algorithm?

  1. A sorting method that sorts by merging two halves

  2. A sorting technique that compares each value to every value before it

  3. A recursive algorithm that selects a pivot

  4. A method that sorts by repeatedly swapping adjacent values

The correct answer is: A sorting technique that compares each value to every value before it

The primary characteristic of the Insertion Sort algorithm is that it sorts by taking each element from the unsorted portion and inserting it into its correct position within the sorted portion of the array. This involves comparing the current value to each of the preceding values and placing it in the appropriate location. This method builds the sorted list incrementally, which is why it is often considered efficient for small datasets or partially sorted data. The other choices refer to different sorting strategies. For example, merging two halves indicates a merge sort, which is a divide-and-conquer algorithm. The reference to a recursive algorithm that selects a pivot applies to quicksort, where the array is divided into sub-arrays based on a chosen pivot element. The method of repeatedly swapping adjacent values describes bubble sort, which works by repeatedly passing through the list and comparing adjacent items. Each of these methods has distinct mechanisms and characteristics that differentiate them from Insertion Sort.