Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: searching for a pattern using suffix arrays (better)

by tye (Cardinal)
on Oct 09, 2013 at 02:46 UTC ( #1057474=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        $mid = int( ( $lo + $hi ) / 2 );
        if ( $hi == $lo ) { return $mid }
    
  2. or download this
        return $hi
            if  $hi == $lo;
        $mid = int( ( $lo + $hi ) / 2 );
    
  3. or download this
        if ( $suff[ $indices[ $index ] ] =~ /^$pattern/ ) {
            push @positions, $indices[ $index ] + 1;
    ...
        else {
            last;
        }
    
  4. or download this
        last
            if  $suff[ $indices[ $index ] ] !~ /^$pattern/;
        push @positions, $indices[ $index ] + 1;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (17)
As of 2014-08-27 16:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (244 votes), past polls