Anonymous user
Permutations: Difference between revisions
m
→{{header|Mathematica}}
(→{{header|Mathematica}}: added version defining permutations from scratch) |
|||
Line 3,798:
insert[L_, x_, n_] := Join[L[[;; n - 1]], {x}, L[[n ;;]]]
(***Generate all permutations of a
permutations[S_] :=
|