1.

Which of the following sorting algorithms is the fastest for sorting small arrays?(a) Quick sort(b) Insertion sort(c) Shell sort(d) Heap sortThis 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

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.



Discussion

No Comment Found

Related InterviewSolutions