P303: Enumeration of all strings of some family

P303: Enumeration of all strings of some family
Input:
Output:
Complexity:
Constant amortized time per solution.
Comment:
This algorithm can list not only all necklaces but also all strings in other some family with CAT.
Reference:
[Cattell2000] (Bibtex)