Definition: Given a ranking, r, generate the rth permutation of n elements.

Note: This can be done in O(n) time.

Author: PEB


(C). (Delphi?). Wendy Myrvold and Frank Ruskey, Ranking and Unranking Permutations in Linear Time, 13 April 2000, give linear time ranking and unranking algorithms.
Go to the Dictionary of Algorithms and Data Structures home page.

If you have suggestions, corrections, or comments, please get in touch with Paul Black.

Entry modified 27 October 2022.
HTML page formatted Thu Oct 27 16:39:43 2022.

Cite this as:
Paul E. Black, "unranking", in Dictionary of Algorithms and Data Structures [online], Paul E. Black, ed. 27 October 2022. (accessed TODAY) Available from: