Merge pull request #460 from y2kbcm1/master

update insertion sorting part
This commit is contained in:
Christian Bender 2018-07-21 20:15:39 +02:00 committed by GitHub
commit 2cbaa808af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@ __Properties__
![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.
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)