Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Binary Search - revisited

by ikegami (Patriarch)
on Nov 15, 2006 at 23:06 UTC ( [id://584326]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # Add $value to sorted @array, if it's not already there.
    $idx = binsearch { $a <=> $b } $value, @array;
    splice(@array, ~$idx, 0, $value) if ($idx < 0);
    
  2. or download this
    sub _unsigned_to_signed {
       return unpack('i', pack('I', $_[0]));
    ...
          }      
       }
    }
    

Log In?
Username:
Password:

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

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

    No recent polls found