Sorting algorithms/Selection sort: Difference between revisions
Added Arturo implementation
(Updated to work with version 1.4 of Nim.) |
Drkameleon (talk | contribs) (Added Arturo implementation) |
||
Line 588:
</lang>
=={{header|Arturo}}==
<lang rebol>selectionSort: function [items][
sorted: new []
tmp: new items
while [not? empty? tmp][
minIndex: index tmp min tmp
'sorted ++ tmp \ minIndex
remove 'tmp .index minIndex
]
return sorted
]
print selectionSort [3 1 2 8 5 7 9 4 6]</lang>
{{out}}
<pre>1 2 3 4 5 6 7 8 9</pre>
=={{header|AutoHotkey}}==
|