answersLogoWhite

0

Insertion sort provides several advantages:

Simple implementation.

Efficient for (quite) small data sets.

Adaptive, i.e. efficient for data sets that are already substantially sorted: the time complexity is O(n + d), where d is the number of inversions.

More efficient in practice than most other simple quadratic, i.e. O(n2) algorithms such as selection sort or bubble sort; the best case (nearly sorted input) is O(n).

Stable, i.e. does not change the relative order of elements with equal keys

In-place, i.e. only requires a constant amount O(1) of additional memory space

Online, i.e. can sort a list as it receives it.

Disadvantages of insertion sort;

It is less efficient on list containing more number of elements.

As the number of elements increases the performance of the program would be slow.

Insertion sort needs a large number of element shifts.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What are advantages and disadvantages of merging?

merge sort is the most efficient way of sorting the list of array.


What are the advantages and disadvantages of selection sort?

No


What are the advantages and disadvantages of sorting algorithm?

shell sort merits and demerits


Who is best merge sort or insertion sort?

Merge sort is good for large data sets, while insertion sort is good for small data sets.


What are the disadvantages of using mail merge?

Advantages: It is quick and easy. It saves time. You can address a large number of letters without having to do it yourself as mail merge inserts it for you. Disadvantages: It can be used as a scam. It runs slowly or doesn't run at all when more than one software is running. If it is email merge all recipients will be able to view all data and information.


What is the difference between shell sort and merge sort?

shell uses an odd number,merge uses an even number?


Different types of sorting techniques in c language?

types of sorting in c language are: insertion sort selection sort bubble sort merge sort two way merge sort heap sort quick sort


What are the advantages and disadvantages of the UN?

disadvantages advantages of osx


What are the disadvantages and advantages of liquor?

What are the disadvantages and advantages of liquor?


What are Advantages and disadvantages of recession?

advantages and disadvantages of recession


What is the advantages and disadvantages of paperless society?

there are no advantages or disadvantages


What are the advantages and disadvantages of OS2?

What are the advantages and disadvantages of OS2?