Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Answer: How can I find the index of the biggest element in an array?

by Jenda (Abbot)
on May 28, 2007 at 14:09 UTC ( #617843=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while ($i--) {
      $max = $i if $data[$i] > $data[$max];
    }
    
  2. or download this
    my $max = 0;
    for (0 .. $#data) {
        $max = $_ if $data[$_] > $data[$max]
    }
    
  3. or download this
    my $max = 0;
    for (1 .. $#data) {
        $max = $_ if $data[$_] > $data[$max]
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (13)
As of 2014-07-28 15:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (204 votes), past polls