Generate all permutations of v, one row per permutation. The result has size factorial (n) * n, where n is the length of v. As an example, perms([1, 2, 3]) returns the matrix 1 2 3 2 1 3 1 3 2 2 3 1 3 1 2 3 2 1
Generate all permutations of v, one row per permutation. The result has size factorial (n) * n, where n is the length of v.
factorial (
) *
As an example, perms([1, 2, 3]) returns the matrix
perms([1, 2, 3])
1 2 3 2 1 3 1 3 2 2 3 1 3 1 2 3 2 1