Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: How can one find five max values and five min values with positions in descending and ascending order from arrays?

by BillKSmith (Vicar)
on Apr 26, 2013 at 13:27 UTC ( #1030829=note: print w/replies, xml ) Need Help??


in reply to How can one find five max values and five min values with positions in descending and ascending order from arrays?

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
  • Comment on Re: How can one find five max values and five min values with positions in descending and ascending order from arrays?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1030829]
help
Chatterbox?
[james28909]: why, what is the point. if you cant see that we are smarter than cavemen then i need to just shutup lol. cavemen didnt propell themselves onto a moon. they stared at it and probably howled
[SuicideJunkie]: We are certainly vastly more educated and wealthy. Raw intelligence is much more difficult to measure.

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2017-12-15 15:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (433 votes). Check out past polls.

    Notices?