Skip to content

fix: InterpolationSearch division by zero (#7466)#7468

Closed
prashantpiyush1111 wants to merge 18 commits into
TheAlgorithms:masterfrom
prashantpiyush1111:fix/interpolation-search-div-zero
Closed

fix: InterpolationSearch division by zero (#7466)#7468
prashantpiyush1111 wants to merge 18 commits into
TheAlgorithms:masterfrom
prashantpiyush1111:fix/interpolation-search-div-zero

Conversation

@prashantpiyush1111

Copy link
Copy Markdown
Contributor

Fixes #7466

Added guard for array[end] == array[start] to prevent
ArithmeticException (division by zero) when all elements
in the search range are equal.

@prashantpiyush1111 prashantpiyush1111 deleted the fix/interpolation-search-div-zero branch June 11, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] InterpolationSearch().find(...) breaks on certain sorted arrays

1 participant