Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^4: Modified Binary Search

by JavaFan (Canon)
on Jan 14, 2010 at 11:21 UTC ( #817383=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    return $i if $A[$i] == $target && ($i == 0 || $A[$i-1] < $target);
    
  2. or download this
    return $i if $A[$i] == $target;
    
  3. or download this
    return $i if $A[$i] == $target && ($i == $#A || $A[$i+1] > $target);
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2021-07-28 11:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?