Consider the following array. Which algorithm out of the following options…

2025

Consider the following array.

image.png

Which algorithm out of the following options uses the least number of comparisons (among the array elements) to sort the above array in ascending order ?

Answer: C. Insertion sortThe given array [23, 32, 45, 69, 72, 73, 89, 97] is already sorted in ascending order. Insertion Sort has a time complexity of O(n) for nearly sorted or…

  1. A.

    Selection sort

  2. B.

    Merge sort

  3. C.

    Insertion sort

  4. D.

    Quicksort using the last element as pivot

Attempted by 315 students.

Show answer & explanation

Correct answer: C

The given array [23, 32, 45, 69, 72, 73, 89, 97] is already sorted in ascending order. Insertion Sort has a time complexity of O(n) for nearly sorted or already sorted arrays, making it the most efficient choice among standard sorting algorithms in this specific case.

Explore the full course: Tpsc Assistant Technical Officer

Loading lesson…