Update exponential_search.cpp

This commit is contained in:
Divide-et-impera-11
2019-11-30 21:15:03 +01:00
committed by GitHub
parent 38fb290b88
commit f197fa38e3

View File

@@ -26,10 +26,10 @@ template<class Type> Type* Struzik_Search(Type* array, size_t size, Type key) {
return nullptr;
}
int main() {
int *sorted_array = new int[7]{7, 10, 15, 23, 70, 105, 203};
assert(Struzik_Search<int>(sorted_array, 7, 0) == nullptr);
assert(Struzik_Search<int>(sorted_array, 7, 1000) == nullptr);
assert(Struzik_Search<int>(sorted_array, 7, 50) == nullptr);
assert(Struzik_Search<int>(sorted_array, 7, 7) == sorted_array);
int *sorted_array = new int[7]{7, 10, 15, 23, 70, 105, 203};
assert(Struzik_Search<int>(sorted_array, 7, 0) == nullptr);
assert(Struzik_Search<int>(sorted_array, 7, 1000) == nullptr);
assert(Struzik_Search<int>(sorted_array, 7, 50) == nullptr);
assert(Struzik_Search<int>(sorted_array, 7, 7) == sorted_array);
return EXIT_SUCCESS;
}