Skip to content

Commit 2cbaa80

Browse files
author
Christian Bender
authored
Merge pull request TheAlgorithms#460 from y2kbcm1/master
update insertion sorting part
2 parents 354e74c + 7a236f7 commit 2cbaa80

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ __Properties__
2424
### Insertion
2525
![alt text][insertion-image]
2626

27-
From [Wikipedia][insertion-wiki]: Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.
27+
From [Wikipedia][insertion-wiki]: Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.
28+
In the figure, each bar represents an element of an array that needs to be sorted. What happens at the first intersection of the top most and second top most bars is to swap these elements, represented by bars, because the second element has a higher precedence than the first element does. By repeating this method, insertion sort completes sorting.
2829

2930
__Properties__
3031
* Worst case performance O(n^2)

0 commit comments

Comments
 (0)