Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: finding local minima/maxima for a discrete array

by DrHyde (Prior)
on Jul 31, 2007 at 10:46 UTC ( [id://629794]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    
    my @values = qw(1 4 3 2 5 6 3 4 2);
    ...
    }
    # @maxima now contains qw(4 6 4);
    print join(', ', (sort { $a <=> $b } @maxima)[0 .. $k - 1])."\n";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://629794]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-19 04:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found