You have to sort a list L consisting of a sorted list followed by a few “random” elements. Which of the following sorting methods would be specially suitable for such a task?

Options
- Bubble sort
- Selection sort
- Quick sort
- Insertion sort


CORRECT ANSWER : Insertion sort

Discussion Board
Data Structure - Insertion Sort

Insertion sort is a simple sorting algorithm. This sorting method sorts the array by shifting elements one by one. It builds the final sorted array one item at a time. Insertion sort has one of the simplest implementation. This sort is efficient for smaller data sets, but it is insufficient for larger lists. It has less space complexity like bubble sort. It requires single additional memory space. Insertion sort does not change the relative order of elements with equal keys because it is stable.

Prajakta Pandit 02-1-2017 04:50 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement