Perl Monk, Perl Meditation | |
PerlMonks |
Re^4: Generator of integer partitionts of nby hv (Prior) |
on Aug 31, 2004 at 13:36 UTC ( [id://387182]=note: print w/replies, xml ) | Need Help?? |
Here's a variant of the same code that stores the current partition as a packed string of bytes instead of an arrayref of integers:
This should be rather more efficient than the arrayref variant Update: silly me, in modern perls this will do the right thing even for much larger values of $n. Hugo
In Section
Seekers of Perl Wisdom
|
|