Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

There is some built-in binary search code but not in the core language as far as I know.

  • There is BinarySearch from the Combinatorica package, which is still the function I use most often despite the fact that that package is now deprecated and loading it causes shadowing of some Symbols.

  • There is the undocumented GeometricFunctions`BinarySearch but this function does not appear to perform particularly well.

When I need greater performance I typically use a compiled forma compiled form of Leonid's code from:

There is some built-in binary search code but not in the core language as far as I know.

  • There is BinarySearch from the Combinatorica package, which is still the function I use most often despite the fact that that package is now deprecated and loading it causes shadowing of some Symbols.

  • There is the undocumented GeometricFunctions`BinarySearch but this function does not appear to perform particularly well.

When I need greater performance I typically use a compiled form of Leonid's code from:

There is some built-in binary search code but not in the core language as far as I know.

  • There is BinarySearch from the Combinatorica package, which is still the function I use most often despite the fact that that package is now deprecated and loading it causes shadowing of some Symbols.

  • There is the undocumented GeometricFunctions`BinarySearch but this function does not appear to perform particularly well.

When I need greater performance I typically use a compiled form of Leonid's code from:

added 19 characters in body
Source Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k

There is some built-in binary search code but not in the core language as far as I know.

  • There is BinarySearch from the Combinatorica package, which is still the function I use most often, despite the fact that that package is now deprecated and loading it causes shadowing of some Symbols.

  • There is the undocumented GeometricFunctions`BinarySearch but this function does not appear to perform particularly well.

When I need greater performanceneed greater performance I typically use a compiled form of Leonid's code from:

There is some built-in binary search code but not in the core language as far as I know.

  • There is BinarySearch from the Combinatorica package, which is still the function I use most often, despite the fact that that package is now deprecated and loading it causes shadowing of some Symbols.

  • There is the undocumented GeometricFunctions`BinarySearch but this function does not appear to perform particularly well.

When I need greater performance I typically use Leonid's code from:

There is some built-in binary search code but not in the core language as far as I know.

  • There is BinarySearch from the Combinatorica package, which is still the function I use most often despite the fact that that package is now deprecated and loading it causes shadowing of some Symbols.

  • There is the undocumented GeometricFunctions`BinarySearch but this function does not appear to perform particularly well.

When I need greater performance I typically use a compiled form of Leonid's code from:

Source Link
Mr.Wizard
  • 273.1k
  • 34
  • 595
  • 1.4k

There is some built-in binary search code but not in the core language as far as I know.

  • There is BinarySearch from the Combinatorica package, which is still the function I use most often, despite the fact that that package is now deprecated and loading it causes shadowing of some Symbols.

  • There is the undocumented GeometricFunctions`BinarySearch but this function does not appear to perform particularly well.

When I need greater performance I typically use Leonid's code from: