Skip to main content

1999 | OriginalPaper | Buchkapitel

An O(1) Time Algorithm for Generating Multiset Permutations

verfasst von : Tadao Takaoka

Erschienen in: Algorithms and Computation

Verlag: Springer Berlin Heidelberg

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

We design an algorithm that generates multiset permutati- ons in O(1) time from permutation to permutations, using only data structures of arrays. The previous O(1) time algorithm used pointers, causing O(n) time to access an element in a permutation, where n is the size of permutations. The central idea in our algorithm is tree traversal. We associate permutations with the leaves of a tree. By traversing this tree, going up and down and making changes when necessary, we spend O(1) time from permutation to permutation. Permutations are generated in a one-dimensional array.

Metadaten
Titel
An O(1) Time Algorithm for Generating Multiset Permutations
verfasst von
Tadao Takaoka
Copyright-Jahr
1999
Verlag
Springer Berlin Heidelberg
DOI
https://doi.org/10.1007/3-540-46632-0_25