Sorting algorithms/Comb sort: Difference between revisions
Content added Content deleted
(→{{header|Icon}}: header fix) |
(→{{header|Icon}}: brief) |
||
Line 410: | Line 410: | ||
end</lang> |
end</lang> |
||
Note: This example relies on [[Sorting_algorithms/Bubble_sort#Icon| the supporting procedures 'sortop', and 'demosort' in Bubble Sort]]. |
Note: This example relies on [[Sorting_algorithms/Bubble_sort#Icon| the supporting procedures 'sortop', and 'demosort' in Bubble Sort]]. The full demosort exercises the named sort of a list with op = "numeric", "string", ">>" (lexically gt, descending),">" (numerically gt, descending), a custom comparator, and also a string. |
||
Abbreviated sample output:<pre>Sorting Demo using procedure combsort |
|||
on list : [ 3 14 1 5 9 2 6 3 ] |
on list : [ 3 14 1 5 9 2 6 3 ] |
||
with op = &null: [ 1 2 3 3 5 6 9 14 ] (0 ms) |
with op = &null: [ 1 2 3 3 5 6 9 14 ] (0 ms) |
||
... |
|||
with op = "numeric": [ 1 2 3 3 5 6 9 14 ] (0 ms) |
|||
with op = "string": [ 1 14 2 3 3 5 6 9 ] (0 ms) |
|||
with op = ">>": [ 9 6 5 3 3 2 14 1 ] (0 ms) |
|||
with op = ">": [ 14 9 6 5 3 3 2 1 ] (0 ms) |
|||
with op = procedure cmp: [ 1 2 3 3 5 6 9 14 ] (0 ms) |
|||
with op = "cmp": [ 1 2 3 3 5 6 9 14 ] (0 ms) |
|||
on string : "qwerty" |
on string : "qwerty" |
||
with op = &null: "eqrtwy" (0 ms)</pre> |
with op = &null: "eqrtwy" (0 ms)</pre> |