Sorting algorithms/Insertion sort: Difference between revisions

m
Mark as using wikipedia content (the algorithm description)
m (Mark as using wikipedia content (the algorithm description))
Line 1:
{{task|Sorting Algorithms}}
{{Sorting Algorithm}}
{{wikipedia|Insertion sort}}
An <span style="font-family: serif">[[O]](''n''<sup>2</sup>)</span> sorting algorithm which moves elements one at a time into the correct position. The algorithm consists of inserting one element at a time into the previously sorted part of the array, moving higher ranked elements up as necessary. To start off, the first (or smallest, or any arbitrary) element of the unsorted array is considered to be the sorted part.
 
Anonymous user