Website Summary Files Commits Branches @commit @diff @stats
path: root / pract_SI / Pract. 05 / Solutions / task6.cpp
diff options
context:
space:
mode:
1 files changed, 1 insertions, 2 deletions
-rw-r--r--pract_SI/Pract. 05/Solutions/task6.cpp3
diff --git a/pract_SI/Pract. 05/Solutions/task6.cpp b/pract_SI/Pract. 05/Solutions/task6.cpp
index a3804fc..2c8a0e9 100644
--- a/pract_SI/Pract. 05/Solutions/task6.cpp
+++ b/pract_SI/Pract. 05/Solutions/task6.cpp
@@ -9,7 +9,7 @@ otherwise -1.
//int m - middle index
//int x - number 'x' we are searching for
-int binarySearch1(int *arr, int l, int r, int x)
+int binarySearch1(const int *arr, int l, int r, int x)
{
while (l <= r)
{
@@ -21,6 +21,5 @@ int binarySearch1(int *arr, int l, int r, int x)
else
r = m - 1; // If x is smaller, ignore right half
}
-
return -1; // if we reach here, then the element was not present
} \ No newline at end of file