Complexity class of generating all permutations

119 Views Asked by At

What is the complexity of the following problem (i.e. to what complexity class does it belong)? Given a positive integer $n$, provide all permutations of the sequence $\{1, 2, \ldots, n\}$.

1

There are 1 best solutions below

0
On

The problem is at least in

$\mbox{FDTIME}(n\cdot n!)$, since the output itself contains $n!$ sequences, each having $n$ entries

and

$\mbox{FDSPACE}(n)$, since a stack of length $n$ is enough. The output doesn't count.

They are defined in this thread.

I don't know whether this is of any use though.