Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 imbibing at the Monastery: (5)
As of 2016-02-08 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (268 votes), past polls