Help for this page

Select Code to Download


  1. or download this
    $query == $array->[$center]
    
  2. or download this
    $query == $array->[$center] && ($begin
       ? ($center == 0        || $query != $array->[$center-1])
       : ($center == $#$array || $query != $array->[$center+1])
    )
    
  3. or download this
    sub binarySearch {
      my ($begin, $query, $array) = @_;
    ...
        $prevCenter = $center;
      }
    }