查找算法1
来源:互联网 发布:学数据库有什么用知乎 编辑:程序博客网 时间:2024/06/14 18:58
#include <iostream>#include <algorithm>#include <vector>#include <functional>using namespace std;int main(){vector<int> ivec;vector<int>::iterator pos;for (int i = 1; i <= 9; ++i)ivec.push_back(i);for (vector<int>::iterator iter = ivec.begin(); iter != ivec.end(); ++iter)cout << *iter << ' ';cout << endl;// 谓词。pos = find_if(ivec.begin(), ivec.end(), bind2nd(greater<int>(), 3)); // 查找大于3的数,cout << *pos << endl;pos = find_if(ivec.begin(), ivec.end(), not1(bind2nd(modulus<int>(), 3))); // modulus是取模运算,cout << *pos << endl; // 查找第一个被3整除的数,return 0;}
0 0
- 二分查找算法1
- STL算法------查找1
- 查找---BF算法(1)
- 查找算法1
- 查找算法1
- 查找算法之hash查找-1
- 查找算法(1)折半查找法
- 数据结构-查找-分块查找(1)算法简介
- 折半查找算法(1)
- 查找算法总结(1)
- 算法之二分查找(1)
- 算法(1)二分查找
- 查找算法总结(1)--概括
- 查找算法学习(1)
- 查找算法(1)基本概念
- 算法入门1:二分查找
- 数据查找算法总结1
- STL算法(1) C++ 查找算法
- 【项目 2 - 就拿胖子说事】
- 钱币兑换问题
- poj2488
- github 本地仓库与远程仓库的交互
- 8088微处理器引脚
- 查找算法1
- Java开发者对于Java所要关注的几个点
- 百练2800:垂直直方图
- word2vec简介
- 蓝桥 算法提高 质数的后代
- SQL Server Connection Strings for ASP.NET Web Applications
- 十道海量数据面试题
- 快速排序
- OSI参考模型