Handbook
Glossary
(next-permutation) ( seq -- seq )
Vocabulary
math
.
combinatorics
.
private
Inputs
seq
an
object
Outputs
seq
an
object
Definition
USING:
kernel
sequences
sequences.private
;
IN:
math.combinatorics.private
:
(next-permutation)
( seq -- seq )
dup
cut-point
[
swap
[
greater-from-last
]
2keep
[
exchange-unsafe
]
[
reverse-tail!
nip
]
3bi
]
[
reverse!
]
if*
;