diff --git a/01_introduction_to_algorithms/c++/01_binary_search.cpp b/01_introduction_to_algorithms/c++/01_binary_search.cpp index a82958e9..27837a5b 100644 --- a/01_introduction_to_algorithms/c++/01_binary_search.cpp +++ b/01_introduction_to_algorithms/c++/01_binary_search.cpp @@ -4,7 +4,7 @@ using namespace std; void binarySearch(int data_array[], int element, int len) { int low = 0; - int high = len; + int high = len -1; while (low <= high) { int mid = (low + high)/2; diff --git a/01_introduction_to_algorithms/c++/01_binary_search.exe b/01_introduction_to_algorithms/c++/01_binary_search.exe new file mode 100644 index 00000000..096135de Binary files /dev/null and b/01_introduction_to_algorithms/c++/01_binary_search.exe differ