Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions search/binary_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ namespace binary_search {
* @returns @param int index of val in vector arr
*******************************************************************************/
uint64_t binarySearch(std::vector<uint64_t> arr, uint64_t val) {
if (arr.size() <= 1) return arr[0];
uint64_t low = 0; // set the lowest point of the vector.
uint64_t high = arr.size() - 1; // set the highest point of the vector.

Expand Down