laziness, impatience, and hubris | |
PerlMonks |
Re: How can one find five max values and five min values with positions in descending and ascending order from arrays?by BillKSmith (Monsignor) |
on Apr 26, 2013 at 13:27 UTC ( [id://1030829]=note: print w/replies, xml ) | Need Help?? |
Often, clarity is more important than efficiency. Sort the indicies into the required order. Print the data from both arrays corresponding to the first five indicies and to last five indicies. The Schwartzian Transformation is a well-known idiom which could be used to reduce the inefficiency.
Bill
In Section
Seekers of Perl Wisdom
|
|