查找算法 binary_serach
发布日期:2022-03-04 12:48:35 浏览次数:31 分类:技术文章

本文共 289 字,大约阅读时间需要 1 分钟。

黑马248

#include
#include
#include
#include
using namespace std;
void test01()
{
vectorv;
for (int i = 0; i < 20; i++)
{
v.push_back(i);
}

bool ret=binary_search(v.begin(), v.end(),25);if (ret){	cout << "find it   "  << endl;}else{	cout << "can not find" << endl;}

}

int main()
{
test01();
}

转载地址:https://blog.csdn.net/qq_43752920/article/details/120547577 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:常用集合算法set_union
下一篇:2021-09-29

发表评论

最新留言

路过按个爪印,很不错,赞一个!
[***.219.124.196]2024年04月21日 15时26分26秒