Foundations of computer science
Foundations of computer science
Discrete mathematics and its applications (2nd ed.)
Discrete mathematics and its applications (2nd ed.)
Reverse search for enumeration
Discrete Applied Mathematics - Special volume: first international colloquium on graphs and optimization (GOI), 1992
A Survey of Combinatorial Gray Codes
SIAM Review
Modern Operating Systems
Computer Networks
Constant Time Generation of Set Partitions
IEICE Transactions on Fundamentals of Electronics, Communications and Computer Sciences
Constant Time Generation of Integer Partitions
IEICE Transactions on Fundamentals of Electronics, Communications and Computer Sciences
Constant time generation of trees with specified diameter
WG'04 Proceedings of the 30th international conference on Graph-Theoretic Concepts in Computer Science
Hi-index | 0.00 |
In this paper, we give an elegant algorithm to generate all distributions of n identical objects to m bins without repetition. The best known previous algorithm, due to Klingsberg, generates each distribution in constant time in average sense. Using a new technique of efficient tree traversal, in this paper we improve the time complexity to constant time (in ordinary sense). By modifying our algorithm, we can generate the distributions in anti-lexicographic order. Overall space complexity of our algorithm is O(mlgn), where m is the number of bins and n is the number of objects.