Sorting algorithms/Permutation sort: Difference between revisions

Content added Content deleted
m (→‎RcppAlgos: Improved syntax.)
(Added Quackery.)
Line 2,010: Line 2,010:
)
)
</lang>
</lang>

=={{header|Quackery}}==

<lang Quackery> [ 1 swap times [ i 1+ * ] ] is ! ( n --> n )

[ [] unrot 1 - times
[ i 1+ ! /mod
dip join ] drop ] is factoradic ( n n --> [ )

[ [] unrot witheach
[ pluck
rot swap nested join
swap ]
join ] is inversion ( [ [ --> [ )

[ over size
factoradic inversion ] is nperm ( [ n --> [ )
[ true swap
behead swap
witheach
[ tuck > if
[ dip not conclude ] ]
drop ] is sorted ( [ --> b )

[ 0
[ 2dup nperm
dup sorted not while
drop 1+ again ]
unrot 2drop ] is sort ( [ --> [ )

$ "beings" sort echo$</lang>

{{out}}

<pre>begins</pre>


=={{header|R}}==
=={{header|R}}==