+1 vote
in Data Structures & Algorithms II by (110k points)
Which of the following sorting algorithms is the fastest for sorting small arrays?

(a) Quick sort

(b) Insertion sort

(c) Shell sort

(d) Heap sort

This question was addressed to me during an interview for a job.

This question is from Insertion sort in section Sorting of Data Structures & Algorithms II

1 Answer

+1 vote
by (614k points)
selected by
Best answer
The correct answer is (b) Insertion sort

Easy explanation - For sorting small arrays, insertion sort runs even faster than quick sort. But, it is impractical to sort large arrays.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.