Ranking and unranking permutations in linear time
Information Processing Letters
Constant time generation of derangements
Information Processing Letters
Discrete Applied Mathematics
Generating derangements by interchanging at most four elements
Systems and Computers in Japan
Enumerative Combinatorics: Volume 1
Enumerative Combinatorics: Volume 1
Hi-index | 0.04 |
We present lexicographic ranking and unranking algorithms for derangements expressed in cycle notation. These algorithms run in O(nlogn) time, require O(n) space, and use O(n) arithmetic operations. Similar algorithms that require less than or equal to O(nlogn) time with O(n) space complexity have not previously been proposed.