Skip to content

java.lang.ArrayIndexOutOfBoundsException with BinarySearch #3248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vie02 opened this issue Sep 4, 2022 · 1 comment
Closed

java.lang.ArrayIndexOutOfBoundsException with BinarySearch #3248

vie02 opened this issue Sep 4, 2022 · 1 comment

Comments

@vie02
Copy link
Contributor

vie02 commented Sep 4, 2022

Describe the bug
java.lang.ArrayIndexOutOfBoundsException with BinarySearch

To Reproduce
Any case with the key is bigger than the biggest number of the array should reproduce the java.lang.ArrayIndexOutOfBoundsException (while should return -1 instead)
Example: search for 20 in [-10, -4, 2, 5, 9, 15]

Expected behavior
java.lang.ArrayIndexOutOfBoundsException was thrown

Screenshots
image

Device Specification

@rakhazachrie
Copy link

Hi, can I work on this issue? thanks

vie02 added a commit to vie02/TheAlgorithms-Java that referenced this issue Sep 5, 2022
@siriak siriak closed this as completed Sep 7, 2022
siriak pushed a commit that referenced this issue Sep 7, 2022
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

No branches or pull requests

3 participants