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

interpolationSearch always returns -1 for array with duplicates #87

Closed
umairnadeem opened this issue Jul 4, 2019 · 1 comment · Fixed by #88
Closed

interpolationSearch always returns -1 for array with duplicates #87

umairnadeem opened this issue Jul 4, 2019 · 1 comment · Fixed by #88

Comments

@umairnadeem
Copy link
Contributor

Description

interpolationSearch always returns -1 even if value is included in an array with duplicates. For instance, if the input is [42,42,42] and the target element is 42, the interpolation search will return -1 although 42 is included in the array.

Versions

  • NodeJS version (if applicable): 8.10.0
  • AlgorithmJS version: 0.0.13

Expected behaviour

interpolationSearch should return 0.

Steps to recreate

Input an array with all the same values in interpolationSearch, and a target element which is included in the array.

People to notify

@manrajgrover

@umairnadeem
Copy link
Contributor Author

I am working on a fix.

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 a pull request may close this issue.

1 participant