未验证 提交 f197fa38 编写于 作者: D Divide-et-impera-11 提交者: GitHub

Update exponential_search.cpp

上级 38fb290b
......@@ -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;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册