Algorithm测试

#include <algorithm>
#include <vector>
#include <iostream> using namespace std; int main()
{
vector<int> vec_1 = {,,,,,,}; auto minpos = min_element(vec_1.cbegin(), vec_1.cend());
vector<int>::iterator vec_min_iter = min_element(vec_1.begin(), vec_1.end());
cout << "min value: " << *minpos << " " << *vec_min_iter << endl; auto maxpos = max_element(vec_1.cbegin(), vec_1.cend());
vector<int>::iterator vec_max_iter = max_element(vec_1.begin(), vec_1.end());
cout << "max value: " << *maxpos << " " << *vec_max_iter << endl; system("pause");
return ;
}

min value: 1 1
max value: 9 9
请按任意键继续. . .

Algorithm测试的更多相关文章

  1. C++ STD Gems02

    remove.remove_if.replace.replace_if.remove_copy_if.unique #include <iostream> #include <str ...

  2. [Algorithm] 使用SimHash进行海量文本去重

    在之前的两篇博文分别介绍了常用的hash方法([Data Structure & Algorithm] Hash那点事儿)以及局部敏感hash算法([Algorithm] 局部敏感哈希算法(L ...

  3. 《In Search of an Understandable Consensus Algorithm》翻译

    Abstract Raft是一种用于管理replicated log的consensus algorithm.它能和Paxos产生同样的结果,有着和Paxos同样的性能,但是结构却不同于Paxos:它 ...

  4. Linux 下测试网卡性能命令iperf 的用法

    很多文件系统都自带iperf 命令,所以不用作多的移植工作. 如下查看他的帮助信息. Qt@aplex:~$ iperf -h Usage: iperf [-s|-c host] [options] ...

  5. LTE 测试文档(翻译)

    Testing Documentation 翻译 (如有不当的地方,欢迎指正!)     1 概述   为了测试和验证 ns-3 LTE 模块,文档提供了几个 test suites (集成在 ns- ...

  6. c++11 function bind 测试。

    实验小结 1)function 是一个模板类.有函数指针成员.可以看作安全型函数指针. template<typename _Res, typename... _ArgTypes> cla ...

  7. algorithm -- 基本介绍

    为学习算法和使用.实践 GIT & GitHub ,而写此系列. 我使用的编译器是 visual studio community 2015 低版本的VS打不开GitHub中的解决方案,拷贝代 ...

  8. Miller_Rabin素数测试

    #include<iostream> #include<cmath> #include<cstdio> #include<cstring> #inclu ...

  9. USACO1.5Superprime Rid[附带关于素数算法时间测试]

    题目描述 农民约翰的母牛总是产生最好的肋骨.你能通过农民约翰和美国农业部标记在每根肋骨上的数字认出它们.农民约翰确定他卖给买方的是真正的质数肋骨,是因为从右边开始切下肋骨,每次还剩下的肋骨上的数字都组 ...

随机推荐

  1. 【Linux】Linux下安装RabbitMQ服务

    一.安装步骤 1)安装erlang yum install -y erlang2)安装rabbitmq-serveryum install -y rabbitmq-server3)开启rabbitmq ...

  2. linux设备驱动程序--在用户空间注册文件接口

    linux字符设备驱动程序--创建设备节点 基于4.14内核,运行在beagleBone green 在上一讲中,我们写了第一个linux设备驱动程序--hello_world,在驱动程序中,我们什么 ...

  3. (二)MongoDB基本概念

    (二)MongoDB基本概念 mongodb 2018年03月07日 08时43分53秒 mognoDB是一个面向文档的数据库,而不是关系型数据库,是不是用关系型数据库主要是为了获得更好的扩展性,还会 ...

  4. Pat 1003 甲级

    #include <cstdlib> #include <cstring> #include <iostream> #include <cstdio> ...

  5. c语言实现基本的数据结构(五) 单链队列

    #include <stdio.h> #include <tchar.h> #include <stdlib.h> #define MaxQueueSize 100 ...

  6. python与设计模式--单例模式

    https://zhuanlan.zhihu.com/p/31675841 设计模式分类 创建类 单例模式.工厂模式.抽象工厂模式.原型模式.建造者模式 结构类 装饰器模式.适配器模式.门面模式.组合 ...

  7. 配置VScode c语言环境

    vscode 提示 <sys/socket.h>找不到, 原来是不同平台上,头文件不一样. 参考:https://blog.csdn.net/qq_28581077/article/det ...

  8. (3)使用Android手机作为树莓派的屏幕

    https://jingyan.baidu.com/album/676629977483b154d51b848e.html

  9. npm link 的用法

    npm link 的用法 先到对应的自定义包下执行 npm link 会读取对应的 packagejson 中的名称 然后到对应的目录下执行 npm link your/own/npm/name 就会 ...

  10. 一个bug程序员的入园

    大家好,我叫dg是一个只写bug的程序员.当然只写bug也是有好处的,那就是踩过的坑多了,摔的跟斗多了,并且没有被摔死,勇敢的活了下来,练就了一身钢筋铁骨.哈哈,开个玩笑.但是猜的坑多了就知道了哪里有 ...