Skip to content
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

Binary search occurrences recursive impls index out of bounds #83

Open
domfarolino opened this issue Jul 25, 2018 · 0 comments
Open

Binary search occurrences recursive impls index out of bounds #83

domfarolino opened this issue Jul 25, 2018 · 0 comments
Labels

Comments

@domfarolino
Copy link
Owner

The recursive binary search "first occurrence" and "last occurrence" variations index out of bounds given an empty array, producing undefined (usually fine though) behavior. This should be fixed. Perhaps in these binary search variants, since we will always come out of the while loop before returning, we should perform size == 0 checks early on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant