算法库algorithm-5-minmax
来源:互联网 发布:女超人于莺离婚知乎 编辑:程序博客网 时间:2024/06/05 00:20
概述
//最值对//tuple< T const&, T const& >minmax(T const& a, T const& b)//tuple< T const&, T const& >minmax(T const& a, T const& b, BinaryPredicate comp)//最值迭代器//std::pair<ForwardIter,ForwardIter>minmax_element(ForwardIter first, ForwardIter last)//std::pair<ForwardIter,ForwardIter>minmax_element(ForwardIter first, ForwardIter last, BinaryPredicate comp)//* first_min_element(first, last)//* first_min_element(first, last, comp)//* last_min_element(first, last)//* last_min_element(first, last, comp)//* first_max_element(first, last)//* first_max_element(first, last, comp)//* last_max_element(first, last)//* last_max_element(first, last, comp)//* first_min_first_max_element(first, last)//* first_min_first_max_element(first, last, comp)//* first_min_last_max_element(first, last)//* first_min_last_max_element(first, last, comp)//* last_min_first_max_element(first, last)//* last_min_first_max_element(first, last, comp)//* last_min_last_max_element(first, last)//* last_min_last_max_element(first, last, comp)
测试
#include <laok.h>#include <boost/algorithm/minmax.hpp>#include <boost/algorithm/minmax_element.hpp>JOB_DEFINE(boost_algorithm , minmax){int a = 10 , b = 100;boost::tuple<int,int> ret = boost::minmax(a,b);PS( ret.get<0>() );PS( ret.get<1>() );}
运行
=====<boost_algorithm_minmax>begin[ret.get<0>()]:[10][ret.get<1>()]:[100]=====<boost_algorithm_minmax>end [State:OK] [Times:0.003s]
扩展了std 的 min_element/max_element
0 0
- 算法库algorithm-5-minmax
- Minmax Algorithm
- STL algorithm算法minmax,minmax_element(36)
- minmax
- 博弈论最小最大算法minmax
- 算法库algorithm-1-algorithm
- (算法设计技巧与分析)MinMax
- C++ 算法库algorithm
- boost::algorithm(字符串算法库)
- 算法库algorithm-0-概览
- 算法库algorithm-2-clamp
- 算法库algorithm-3-gather
- 算法库algorithm-4-hex
- 算法库algorithm-6-searching
- 算法库algorithm-7-cxx11
- 算法库algorithm-8-cxx14
- 算法库algorithm-9-string
- STL algorithm算法binary_search(5)
- 构造算法的思维过程
- leetcode_p6_ZigZag_Conversion_c++
- gdb C++程序coredump不显示行号问题
- [linux 命令] ctags
- 如何实现货币数据的格式化输出
- 算法库algorithm-5-minmax
- iOS 新项目搭建
- android上传图片至服务器
- 事件和消息的区别
- Hibernate 关联映射one-to-one
- 无线轮播
- Matrix使用解析
- Homework After Class
- vsftp匿名用户上传下载配置