Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
2 files changed, 2 insertions, 3 deletions
-rw-r--r--pract_SI/Pract. 05/Solutions/task4.cpp2
-rw-r--r--pract_SI/Pract. 05/Solutions/task6.cpp3
diff --git a/pract_SI/Pract. 05/Solutions/task4.cpp b/pract_SI/Pract. 05/Solutions/task4.cpp
index 19c1f38..2485b98 100644
--- a/pract_SI/Pract. 05/Solutions/task4.cpp
+++ b/pract_SI/Pract. 05/Solutions/task4.cpp
@@ -1,4 +1,4 @@
-bool isPalindrom(int *arr, int size)
+bool isPalindrom(const int *arr, int size)
{
for (int i = 0; i < size / 2; i++)
{
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