© 1982 by British Computer Society
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Functional Programs for Generating Permutations
Department of Computer Science, Monash University, Clayton, Victoria, Australia
This paper presents several functional programs for generating permutations represented as linear linked lists. Exact formulas for the storage used by some of these programs are derived and compared with the theoretical lower bound. Two different programs are shown to be optimal with respect to this measure. Problems considered include generation of all N! permutations of N distinct elements, generation of all permutations of length k
N, and generation of all distinct permutations of a multiset of N elements.
Received August 1981.
* Department of Computer Science, Monash University, Clayton, Victoria 33168, Australia