Skip to content

Commit 7a236f7

Browse files
authored
update insertion sorting part
- fixed lack description of the figure.
1 parent 595cc8f commit 7a236f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

+2-1
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)