From c1629a93909943794d77db3536a2c1ca2e3efa90 Mon Sep 17 00:00:00 2001 From: Divide-et-impera-11 <54957167+Divide-et-impera-11@users.noreply.github.com> Date: Sat, 30 Nov 2019 21:20:54 +0100 Subject: [PATCH] Update exponential_search.cpp --- Search/exponential_search.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Search/exponential_search.cpp b/Search/exponential_search.cpp index 90ce27409..1c12351a2 100644 --- a/Search/exponential_search.cpp +++ b/Search/exponential_search.cpp @@ -13,7 +13,7 @@ while (lower_index <= upper_index) { } return nullptr; } -template Type* Struzik_Search(Type* array, size_t size, Type key) { +template Type* struzik_search(Type* array, size_t size, Type key) { uint32_t block_front(0), block_size = size == 0 ? 0 : 1; while (block_front != block_size) { if (*(array + block_size - 1) < key) { @@ -27,9 +27,9 @@ return nullptr; } int main() { int *sorted_array = new int[7]{7, 10, 15, 23, 70, 105, 203}; -assert(Struzik_Search(sorted_array, 7, 0) == nullptr); -assert(Struzik_Search(sorted_array, 7, 1000) == nullptr); -assert(Struzik_Search(sorted_array, 7, 50) == nullptr); -assert(Struzik_Search(sorted_array, 7, 7) == sorted_array); -return EXIT_SUCCESS; +assert(struzik_search(sorted_array, 7, 0) == nullptr); +assert(struzik_search(sorted_array, 7, 1000) == nullptr); +assert(struzik_search(sorted_array, 7, 50) == nullptr); +assert(struzik_search(sorted_array, 7, 7) == sorted_array); +return 0; }