# Iterating Permutations. With an Implementation in Rust.

In many practical combinatorial problems there arises the need to iterate over all permutations of a given set. Since the number of permutations increases in factorial time, that is, `n!`

for a `n`

-element set, this can lead to a huge amount of data.

Permutations of a given list `[x1, x2, …, x_n]`

can be computed relatively easily by a **recursive** algorithm like this: