Permutations: Difference between revisions
m
→{{header|Phix}}: use new builtin
m (→{{header|Phix}}: use new builtin) |
|||
Line 6,734:
=={{header|Phix}}==
<!--<lang Phix>(phixonline)-->
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
<span style="color: #
<span style="color: #
<!--</lang>-->
{{out}}
<pre>
{"
</pre>
The elements can be any type. There is also a permute() function which accepts an integer between 1 and factorial(length(s)) and returns the permutations in lexicographical position order. It is just as fast to generate the (n!)th permutation as the first, so some applications may benefit by storing an integer key rather than duplicating all the elements of the given set.
=={{header|Phixmonti}}==
|