Help for this page

Select Code to Download


  1. or download this
    my @arr = (1 .. 1_000_000);
    my $x   = 425983;
    printf "search for $x? found at position: %s\n", binarySearch(0,$x,\@a
    +rr);
    
  2. or download this
    sub binarySearch {
      my ($begin, $query, $array) = @_;
    ...
        $prevCenter = $center;
      }
    }