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.
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
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