Anonymous user
Sorting algorithms/Insertion sort: Difference between revisions
m
added whitespace, used numbered bullet points.
m (→{{header|REXX}}: added whitespace and a comment, used a template for the output section.) |
m (added whitespace, used numbered bullet points.) |
||
Line 10:
Although insertion sort is an <span style="font-family: serif">[[O]](''n''<sup>2</sup>)</span> algorithm, its simplicity, low overhead, good locality of reference and efficiency make it a good choice in two cases: <br>
:# as the final finishing-off algorithm for <span style="font-family: serif">[[O]](''n'' log''n'')</span> algorithms such as [[Merge sort|mergesort]] and [[quicksort]].
The algorithm is as follows (from [[wp:Insertion_sort#Algorithm|wikipedia]]):
|