Update interpolation_search.cpp

This commit is contained in:
Lajat5 2021-12-18 12:35:03 +05:30 committed by GitHub
parent 79df69d582
commit c98405b3cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,7 @@ namespace search {
* @param number value to be searched
* @returns integer index of `number` in vector `arr`
*******************************************************************************/
uint64_t interpolationSearch(std::vector<uint64_t> &arr, uint64_t number) {
uint64_t interpolationSearch(const std::vector<uint64_t> &arr, uint64_t number) {
uint64_t size = arr.size();
uint64_t low = 0, high = (size - 1);