Merge pull request #460 from y2kbcm1/master
update insertion sorting part
This commit is contained in:
commit
2cbaa808af
@ -24,7 +24,8 @@ __Properties__
|
||||
### Insertion
|
||||
![alt text][insertion-image]
|
||||
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
|
||||
__Properties__
|
||||
* Worst case performance O(n^2)
|
||||
|
Loading…
Reference in New Issue
Block a user