in reply to Generate all (0,1)-sequences in lexicographic order
Why do you need both @seqs_0 and @seqs_1? They'll both hold the same thing, and you're dealing with them destructively. Unless I'm missing something, I'd think you could do
my @subseq = gen_seqs($n-1); unshift @$seq, 0 foreach @subseq; unshift @$seq, 1 foreach @subseq; push @seqs, @subseq, @subseq;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re(2): Generate all (0,1)-sequences in lexicographic order
by FoxtrotUniform (Prior) on Mar 09, 2003 at 22:42 UTC |