© 1988 by British Computer Society
| ||||||||||||||||||||||||||||||||||||||||||||||||||
A Fast Algorithm for Generating Set Partitions
Department of Computer Science, The University of Western Australia, Nedlands, WA 6009, Australia
A recursive algorithm for generating all partitions of the set {1, 2, ..., n} is presented. The average time complexity per partition generated of this algorithm is
(1.6). This algorithm runs faster than the previously fastest algorithm, whose average time complexity per partition is
(4). An empirical test confirms that this is indeed the case.
Received January 1987.
* Department of Computer Science, The University of Western Australia, Nedlands, W A6009, Australia