I wasn't sure how to implement that using the built in sort function. It allows me to keep track of and print out the information for both regions.
Just try to sort the indices and then map both arrays by them:
my @ind_srtd = sort { $array->[$a] cmp $array->[$b] } (0..$#$array); my @array_srtd = map { $array->[$_] } @ind_srtd; my @array_which_srtd = map { $array_which->[$_] } @ind_srtd;
I didn't tested it thoroughly, but should look something like this.
In reply to Re^3: A more efficient sort or heap algorithm...
by przemo
in thread A more efficient sort or heap algorithm...
by bioinformatics
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |