Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Why does my get_max_index function return zero? (High Water Mark Algorithm)

by bliako (Monsignor)
on Jun 03, 2019 at 18:48 UTC ( [id://11100914]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @arr = (1,2,3,5,10,3,4,300,1,2,-2);
    my ($i) = map { $_->[0] } sort { $b->[1] <=> $a->[1] } map { [ $_ , $a
    +rr[$_] ] } 0..$#arr; 
    print "i=$i\n"; # index 7 => value 300
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2024-04-23 09:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found