Jump to content

Sorting algorithms/Permutation sort: Difference between revisions

added Factor
No edit summary
(added Factor)
Line 524:
[2, 3, 8, 10, 10, 14, 17, 18, 19]
</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}}==
<lang freebasic>' version 07-04-2017
1,808

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.