Skip to content
Related Articles

Related Articles

Algorithms | Sorting | Question 15
  • Difficulty Level : Easy
  • Last Updated : 15 Feb, 2013

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 take \theta(n) time when input array is already sorted.

Quiz of this Question

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :