in reply to Optimization of array looping...
Why not use slices to obtain and copy a complete subset of parent 1 in one operation and then parent2 in a second operation?
@newArray = ( @parent1[0..$crossover], @parent2[$crossover+1..$#parent2] );
Darn, my brain has gone blank. There must be a better way to specify the slice continues until the end of the array: $parent2[-1] is the last element, but @parent[3..-1] is empty even if @parent2 has more than four elements.
--
TTTATCGGTCGTTATATAGATGTTTGCA
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Optimization of array looping...
by QM (Parson) on Mar 04, 2004 at 04:11 UTC | |
by antirice (Priest) on Mar 04, 2004 at 05:17 UTC | |
| |
by jweed (Chaplain) on Mar 04, 2004 at 05:00 UTC |