Open In App

Algorithms | Sorting | Question 15

Like Article
Like
Save Article
Save
Share
Report issue
Report

Which sorting algorithm will take least time when all elements of input array are identical? Consider typical implementations of sorting algorithms.

(A)

Insertion Sort

(B)

Heap Sort

(C)

Merge Sort

(D)

Selection Sort


Answer: (A)

Explanation:

The insertion sort will O(n) time when input array is already sorted.


Quiz of this Question
Please comment below if you find anything wrong in the above post


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads