reference url:http://www.cplusplus.com/reference/algorithm

reference url:https://blog.csdn.net/Swust_Zeng_zhuo_K/article/details/80113384

<algorithm>

Standard Template Library: Algorithms

The header <algorithm>
A range is any sequence of objects that can be accessed through iterators or pointers, such as an array or an instance of some of the . Notice though, that algorithms operate through iterators directly on the values, not affecting in any way the structure of any possible container (it never affects the size or storage allocation of the container).

Functions

Non-modifying sequence operations

  • any_of

    Test if any element in range fulfills condition (function template )

  • none_of

    Test if no elements fulfill condition (function template )

  • for_each

    Apply function to range (function template )

  • find

    Find value in range (function template )

  • find_if

    Find element in range (function template )

  • find_if_not

    Find element in range (negative condition) (function template )

  • find_end

    Find last subsequence in range (function template )

  • find_first_of

    Find element from set in range (function template )

  • adjacent_find

    Find equal adjacent elements in range (function template )

  • count

    Count appearances of value in range (function template )

  • count_if

    Return number of elements in range satisfying condition (function template )

  • mismatch

    Return first position where two ranges differ (function template )

  • equal

    Test whether the elements in two ranges are equal (function template )

  • is_permutation

    Test whether range is permutation of another (function template )

  • search

    Search range for subsequence (function template )

  • search_n

    Search range for elements (function template )

Modifying sequence operations

  • copy_n

    Copy elements (function template )

  • copy_if

    Copy certain elements of range (function template )

  • copy_backward

    Copy range of elements backward (function template )

  • move

    Move range of elements (function template )

  • move_backward

    Move range of elements backward (function template )

  • swap

    Exchange values of two objects (function template )

  • swap_ranges

    Exchange values of two ranges (function template )

  • iter_swap

    Exchange values of objects pointed to by two iterators (function template )

  • transform

    Transform range (function template )

  • replace

    Replace value in range (function template )

  • replace_if

    Replace values in range (function template )

  • replace_copy

    Copy range replacing value (function template )

  • replace_copy_if

    Copy range replacing value (function template )

  • fill

    Fill range with value (function template )

  • fill_n

    Fill sequence with value (function template )

  • generate

    Generate values for range with function (function template )

  • generate_n

    Generate values for sequence with function (function template )

  • remove

    Remove value from range (function template )

  • remove_if

    Remove elements from range (function template )

  • remove_copy

    Copy range removing value (function template )

  • remove_copy_if

    Copy range removing values (function template )

  • unique

    Remove consecutive duplicates in range (function template )

  • unique_copy

    Copy range removing duplicates (function template )

  • reverse

    Reverse range (function template )

  • reverse_copy

    Copy range reversed (function template )

  • rotate

    Rotate left the elements in range (function template )

  • rotate_copy

    Copy range rotated left (function template )

  • random_shuffle

    Randomly rearrange elements in range (function template )

  • shuffle

    Randomly rearrange elements in range using generator (function template )

Partitions

Sorting

  • stable_sort

    Sort elements preserving order of equivalents (function template )

  • partial_sort

    Partially sort elements in range (function template )

  • partial_sort_copy

    Copy and partially sort range (function template )

  • is_sorted

    Check whether range is sorted (function template )

  • is_sorted_until

    Find first unsorted element in range (function template )

  • nth_element

    Sort element in range (function template )

Binary search

  • upper_bound

    Return iterator to upper bound (function template )

  • equal_range

    Get subrange of equal elements (function template )

  • binary_search

    Test if value exists in sorted sequence (function template )

Merge

  • inplace_merge

    Merge consecutive sorted ranges (function template )

  • includes

    Test whether sorted range includes another sorted range (function template )

  • set_union

    Union of two sorted ranges (function template )

  • set_intersection

    Intersection of two sorted ranges (function template )

  • set_difference

    Difference of two sorted ranges (function template )

  • set_symmetric_difference

    Symmetric difference of two sorted ranges (function template )

Heap

  • pop_heap

    Pop element from heap range (function template )

  • make_heap

    Make heap from range (function template )

  • sort_heap

    Sort elements of heap (function template )

  • is_heap

    Test if range is heap (function template )

  • is_heap_until

    Find first element not in heap order (function template )

Min/max

  • max

    Return the largest (function template )

  • minmax

    Return smallest and largest elements (function template )

  • min_element

    Return smallest element in range (function template )

  • max_element

    Return largest element in range (function template )

  • minmax_element

    Return smallest and largest elements in range (function template )

Other

<numeric>

Generalized numeric operations

This header describes a set of algorithms to perform certain operations on sequences of numeric values.

Due to their flexibility, they can also be adapted for other kinds of sequences.

Functions

  • accumulate

    Accumulate values in range (function template )

  • adjacent_difference

    Compute adjacent difference of range (function template )

  • inner_product

    Compute cumulative inner product of range (function template )

  • partial_sum

    Compute partial sums of range (function template )

  • iota

    Store increasing sequence (function template )

<functional>

Function objects

Function objects

They are typically used as arguments to functions, such as predicates or comparison functions passed to standard algorithms

Functions

These functions create objects of wrapper classes based on its arguments:

  • cref

    Construct reference_wrapper to const (function template )

  • mem_fn

    Convert member function to function object (function template )

  • not1

    Return negation of unary function object (function template )

  • not2

    Return negation of binary function object (function template )

  • ref

    Construct reference_wrapper (function template )

Classes

Wrapper classes

Wrapper classes

Operator classes

Operator classes

  • bit_or

    Bitwise OR function object class (class template )

  • bit_xor

    Bitwise XOR function object class (class template )

  • divides

    Division function object class (class template )

  • equal_to

    Function object class for equality comparison (class template )

  • greater

    Function object class for greater-than inequality comparison (class template )

  • greater_equal

    Function object class for greater-than-or-equal-to comparison (class template )

  • less

    Function object class for less-than inequality comparison (class template )

  • less_equal

    Function object class for less-than-or-equal-to comparison (class template )

  • logical_and

    Logical AND function object class (class template )

  • logical_not

    Logical NOT function object class (class template )

  • logical_or

    Logical OR function object class (class template )

  • minus

    Subtraction function object class (class template )

  • modulus

    Modulus function object class (class template )

  • multiplies

    Multiplication function object class (class template )

  • negate

    Negative function object class (class template )

  • not_equal_to

    Function object class for non-equality comparison (class template )

  • plus

    Addition function object class (class template )

Other classes

Namespaces

【转载】algorithm、numeric、functional的更多相关文章

  1. C++ STL 一般总结(转载)

    注:原博地址:http://www.cnblogs.com/biyeymyhjob/archive/2012/07/22/2603525.html 以下内容来源网上 经过整合而成 一.一般介绍 STL ...

  2. C++ STL 一般总结

    以下内容来源网上 经过整合而成(转载) 一.一般介绍 STL(Standard Template Library),即标准模板库,是一个具有工业强度的,高效的C++程序库.它被容纳于C++标准程序库( ...

  3. C++的STL

    今天,看一段代码的时候发现只一句话就做了个排序,是这样的: sort(rotateArray.begin(),rotateArray.end()); 很震惊,后来查了一下sort的用法, sort函数 ...

  4. STL---总结

    文章转自:http://www.cnblogs.com/biyeymyhjob/archive/2012/07/22/2603525.html 一.STL的六大组件 容器(Container),是一种 ...

  5. c++中级 STL基础学习(二)

    deque 和vector差不多,可以在前端后端插入,一般用deque取代vector,vector只能在后端插入push_back().deque还可以push_front(),但是deque后端插 ...

  6. C++中的容器类详解

    一.STL容器类 STL(Standard Template Library)的六大组件:容器(containers).迭代器(iterators).空间配置器(allocator).配接器(adap ...

  7. STL算法

    STL算法部分主要由头文 件<algorithm>,<numeric>,<functional>组成.要使用 STL中的算法函数必须包含头文件<algorit ...

  8. 【STL源码学习】STL算法学习之一

    第一章:引子 STL包含的算法头文件有三个:<algorithm><numeric><functional>,其中最大最常用的是<algorithm>, ...

  9. STL中的所有算法(70个)

    STL中的所有算法(70个)----9种类型(略有修改by crazyhacking) 参考自: http://www.cppblog.com/mzty/archive/2007/03/14/1981 ...

  10. C++之STL总结精华笔记

                       一.一般介绍      STL(StandardTemplate Library),即标准模板库,是一个具有工业强度的,高效的C++程序库.它被容纳于C++标准程 ...

随机推荐

  1. QT--TCP网络编程(客户端/服务器)

    QT -----TCP网络编程   1.主要流程 1.客户端 创建QTcpSocket对象 连接到服务器 --connectToHost() 发送数据 ---write() 读取数据 ---readA ...

  2. 【杭研大咖说】温正湖:6年,从不会写SQL到数据库专家

    他是业界主流数据库技术会议的明星讲师,开源社区各种分享活动的活跃分子:他累计申请了10多个技术发明专利,已授权8个:他近一年发布60多篇高质量技术博客文章,阅读量数十万:他和团队对MyRocks的优化 ...

  3. tl-wr742n 怎么设置dns

    打开无线路由器,用笔记本设置,点击无线网络,点击连接需要设置的无线路由  在弹出的菜单点击[是]  在无线路由器有的背面有个标签,上面PIN码,输入PIN码  打开IE浏览器在地址栏输入192.168 ...

  4. LinuxProbe小结

    1.修改主机名: /etc/hostname 2.配置 yum 软件仓库: (1)进入到 /etc/yum.repos.d/目录下,创建一个linuxprobe.repo的新文件(文件名称任意,结尾必 ...

  5. Azure上的时序见解,Time series insights

    5G来了,广连接(mmTC)可以实现每平方千米100万的连接数(理论值),是4G的10倍,5G网络出现,配合其他技术,空间将在数据意义上剧烈压缩,车联网.智能家居.智能安防.智慧工厂.智慧能源都可能带 ...

  6. 【译】浅谈SOLID原则

    SOLID原则是一种编码的标准,为了避免不良设计,所有的软件开发人员都应该清楚这些原则.SOLID原则是由Robert C Martin推广并被广泛引用于面向对象编程中.正确使用这些规范将提升你的代码 ...

  7. Dubbo学习系列之十二(Quartz任务调度)

    Quartz词义为"石英"水晶,然后聪明的人类利用它发明了石英手表,因石英晶体在受到电流影响时,它会产生规律的振动,于是,这种时间上的规律,也被应用到了软件界,来命名了一款任务调度 ...

  8. 操作mysql第一次访问速度慢(远程)

    最近在使用java操作远程的mysql数据库的时候,第一次请求非常的慢,而且极其容易引起系统的崩溃报错连接超时 下面就这个问题来解决下把 ------------------------------- ...

  9. How to: Use XPO Upcasting in XAF 如何:在 XAF 中使用 XPO 强制转换

    In this topic, you will learn how to use the Upcasting feature of XPO in XAF. It is useful when you ...

  10. CAD图纸怎么看?这两种方法值得看

    在CAD日常的工作中,每天都是需要接触到CAD图纸文件,有一些房屋设计.建筑施工图.室内家具设计图纸等,这些CAD图纸的格式均为dwg格式的.是不能够直接进行打开查看的,需要借助CAD看图软件来使用. ...