all-permutations ( seq -- seq' )


Vocabulary
math.combinatorics

Inputs and outputs
seqa sequence
seq'a sequence


Word description
Outputs a sequence containing all permutations of seq in lexicographical order.

Examples
USING: math.combinatorics prettyprint ; { 0 1 2 } all-permutations .
{ { 0 1 2 } { 0 2 1 } { 1 0 2 } { 1 2 0 } { 2 0 1 } { 2 1 0 } }


Definition