Permutations: Difference between revisions
Content added Content deleted
(→{{header|UNIX Shell}}: Add implementation) |
|||
Line 9,303: | Line 9,303: | ||
function permuteAn { |
function permuteAn { |
||
# |
# print all permutations of first n elements of the array A, with remaining |
||
# elements unchanged. |
# elements unchanged. |
||
local -i n=$1 i |
local -i n=$1 i |
||
Line 9,326: | Line 9,326: | ||
{{works with|Z Shell}} |
{{works with|Z Shell}} |
||
<syntaxhighlight lang="zsh">function permuteAn { |
<syntaxhighlight lang="zsh">function permuteAn { |
||
# |
# print all permutations of first n elements of the array A, with remaining |
||
# elements unchanged. |
# elements unchanged. |
||
local -i n=$1 i |
local -i n=$1 i |
||
Line 9,373: | Line 9,373: | ||
3 2 4 1 |
3 2 4 1 |
||
2 3 4 1</pre> |
2 3 4 1</pre> |
||
=={{header|Ursala}}== |
=={{header|Ursala}}== |