Permutations: Difference between revisions

m
(→‎{{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 setlist S:*)
 
permutations[S_] :=
Anonymous user