Sorting algorithms/Permutation sort: Difference between revisions
Content added Content deleted
No edit summary |
(added Factor) |
||
Line 524: | Line 524: | ||
[2, 3, 8, 10, 10, 14, 17, 18, 19] |
[2, 3, 8, 10, 10, 14, 17, 18, 19] |
||
</pre> |
</pre> |
||
=={{header|Factor}}== |
|||
<lang factor>USING: grouping io math.combinatorics math.order prettyprint ; |
|||
IN: rosetta-code.permutation-sort |
|||
: permutation-sort ( seq -- seq' ) |
|||
[ [ before=? ] monotonic? ] find-permutation ; |
|||
{ 10 2 6 8 1 4 3 } permutation-sort . |
|||
"apple" permutation-sort print</lang> |
|||
{{out}} |
|||
<pre> |
|||
{ 1 2 3 4 6 8 10 } |
|||
aelpp |
|||
</pre> |
|||
=={{header|FreeBASIC}}== |
=={{header|FreeBASIC}}== |
||
<lang freebasic>' version 07-04-2017 |
<lang freebasic>' version 07-04-2017 |