Perl: the Markov chain saw | |
PerlMonks |
Re^5: One Zero variants_without_repetitionby GrandFather (Saint) |
on Aug 07, 2007 at 21:03 UTC ( [id://631155]=note: print w/replies, xml ) | Need Help?? |
Perhaps if you told us what you were trying to achieve we might understand what it is that you actually need. Up to now every time someone suggests a new solution you have introduced a new requirement. Tell us what you need this for and what the constraints are on the input parameters and what the requirements are for the output. A fairly trivial change to the recursive code I gave will change it to work with a string of characters rather than a "string" of bits. You would still run into deep recursion issues with large numbers of ones and other solutions are likely to be faster (memory constraints on recursion are unlikely to be a factor though) however. DWIM is Perl's answer to Gödel
In Section
Seekers of Perl Wisdom
|
|