STL_Lesson005_002

2024-06-06 12:08
文章标签 stl 002 lesson005

本文主要是介绍STL_Lesson005_002,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

容器中的与算法中的重名函数

array:fill    Fill array with value (public member function )fill    Fill range with value (function template )swap    Swap content (public member function )swap    Exchange values of two objects (function template )vector:swap    Swap content (public member function )swap    Exchange contents of vectors (function template )swap    Exchange values of two objects (function template )deque:swap    Swap content (public member function )swap    Exchanges the contents of two deque containers (function template )swap    Exchange values of two objects (function template )forward_list:swap            Swap content (public member function )swap (forward_list) Exchanges the contents of two forward_list containers (function template )swap            Exchange values of two objects (function template )remove          Remove elements with specific value (public member function )remove          Remove value from range (function template )remove_if       Remove elements fulfilling condition (public member function template )remove_if       Remove elements from range (function template )unique          Remove duplicate values (public member function )unique          Remove consecutive duplicates in range (function template )merge           Merge sorted lists (public member function )merge           Merge sorted ranges (function template )sort            Sort elements in container (public member function )sort            Sort elements in range (function template )reverse         Reverse the order of elements (public member function )reverse         Reverse range (function template )list:swap        Swap content (public member function )swap (list) Exchanges the contents of two lists (function template )swap        Exchange values of two objects (function template )remove      Remove elements with specific value (public member function )remove      Remove value from range (function template )remove_if   Remove elements fulfilling condition (public member function template )remove_if   Remove elements from range (function template )unique      Remove duplicate values (public member function )unique      Remove consecutive duplicates in range (function template )sort        Sort elements in container (public member function )sort        Sort elements in range (function template )reverse     Reverse the order of elements (public member function )reverse     Reverse range (function template )stack:swap        Swap contents (public member function )swap (stack)    Exchange contents of stacks (public member function )swap        Exchange values of two objects (function template )queue:swap        Swap contents (public member function )swap (queue)    Exchange contents of queues (public member function )swap        Exchange values of two objects (function template )priority_queue:swap        Swap contents (public member function )swap (queue)    Exchange contents of priority queues (public member function )swap        Exchange values of two objects (function template )set:swap        Swap content (public member function )swap        Exchange values of two objects (function template )find        Get iterator to element (public member function )find        Find value in range (function template )count       Count elements with a specific value (public member function )count       Count appearances of value in range (function template )lower_bound Return iterator to lower bound (public member function )lower_bound Return iterator to lower bound (function template )upper_bound Return iterator to upper bound (public member function )upper_bound Return iterator to upper bound (function template )equal_range Get range of equal elements (public member function )equal_range Get subrange of equal elements (function template )multiset:swap        Swap content (public member function )swap        Exchange values of two objects (function template )find        Get iterator to element (public member function )find        Find value in range (function template )count       Count elements with a specific key (public member function )count       Count appearances of value in range (function template )lower_bound Return iterator to lower bound (public member function )lower_bound Return iterator to lower bound (function template )upper_bound Return iterator to upper bound (public member function )upper_bound Return iterator to upper bound (function template )equal_range Get range of equal elements (public member function )equal_range Get subrange of equal elements (function template )map:swap        Swap content (public member function )swap        Exchange values of two objects (function template )find        Get iterator to element (public member function )find        Find value in range (function template )count       Count elements with a specific key (public member function )count       Count appearances of value in range (function template )lower_bound Return iterator to lower bound (public member function )lower_bound     Return iterator to lower bound (function template )upper_bound Return iterator to upper bound (public member function )upper_bound     Return iterator to upper bound (function template )equal_range Get range of equal elements (public member function )equal_range Get subrange of equal elements (function template )multimap:swap        Swap content (public member function )swap        Exchange values of two objects (function template )find        Get iterator to element (public member function )find        Find value in range (function template )count       Count elements with a specific key (public member function )count       Count appearances of value in range (function template )lower_bound Return iterator to lower bound (public member function )lower_bound     Return iterator to lower bound (function template )upper_bound Return iterator to upper bound (public member function )upper_bound     Return iterator to upper bound (function template )equal_range Get range of equal elements (public member function )equal_range     Get subrange of equal elements (function template )unordered_set:find        Get iterator to element (public member function)equal_range Get subrange of equal elements (function template )count       Count elements with a specific key (public member function)count       Count appearances of value in range (function template )equal_range Get range of elements with a specific key (public member function)equal_range Get subrange of equal elements (function template )swap        Swap content (public member function)swap        Exchange values of two objects (function template )unordered_multiset:find        Get iterator to element (public member function)equal_range Get subrange of equal elements (function template )count       Count elements with a specific key (public member function)count       Count appearances of value in range (function template )equal_range Get range of elements with a specific key (public member function)equal_range Get subrange of equal elements (function template )swap        Swap content (public member function)swap        Exchange values of two objects (function template )unordered_map:find        Get iterator to element (public member function)equal_range Get subrange of equal elements (function template )count       Count elements with a specific key (public member function)count       Count appearances of value in range (function template )equal_range Get range of elements with a specific key (public member function)equal_range Get subrange of equal elements (function template )swap        Swap content (public member function)swap        Exchange values of two objects (function template )unordered_multimap:find        Get iterator to element (public member function)equal_range Get subrange of equal elements (function template )count       Count elements with a specific key (public member function)count       Count appearances of value in range (function template )equal_range Get range of elements with a specific key (public member function)equal_range Get subrange of equal elements (function template )swap        Swap content (public member function)swap        Exchange values of two objects (function template )

这里写图片描述

这篇关于STL_Lesson005_002的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1036062

相关文章

JavaSE-易错题集-002

1. 下面有关java基本类型的默认值和取值范围,说法错误的是? A 字节型的类型默认值是0,取值范围是-2^7—2^7-1 B boolean类型默认值是false,取值范围是true\false C 字符型类型默认是0,取值范围是-2^15 —2^15-1 D long类型默认是0,取值范围是-2^63—2^63-1 答案:C 题解:注意字符型(char) char 占16位,

STL经典案例(四)——实验室预约综合管理系统(项目涉及知识点很全面,内容有点多,耐心看完会有收获的!)

项目干货满满,内容有点过多,看起来可能会有点卡。系统提示读完超过俩小时,建议分多篇发布,我觉得分篇就不完整了,失去了这个项目的灵魂 一、需求分析 高校实验室预约管理系统包括三种不同身份:管理员、实验室教师、学生 管理员:给学生和实验室教师创建账号并分发 实验室教师:审核学生的预约申请 学生:申请使用实验室 高校实验室包括:超景深实验室(可容纳10人)、大数据实验室(可容纳20人)、物联网实验

C++ STL 适配器

系列文章目录 模板特例化,偏特化,左右值引用 https://blog.csdn.net/surfaceyan/article/details/126794013 C++ STL 关联容器 https://blog.csdn.net/surfaceyan/article/details/127414434 C++ STL 序列式容器(二) https://blog.csdn.net/surfac

C++ STL关联容器Set与集合论入门

1. 简介 Set(集合)属于关联式容器,也是STL中最实用的容器,关联式容器依据特定的排序准则,自动为其元素排序。Set集合的底层使用一颗红黑树,其属于一种非线性的数据结构,每一次插入数据都会自动进行排序,注意,不是需要排序时再排序,而是每一次插入数据的时候其都会自动进行排序。因此,Set中的元素总是顺序的。 Set的性质有:数据自动进行排序且数据唯一,是一种集合元素,允许进行数学上的集合相

stl的sort和手写快排的运行效率哪个比较高?

STL的sort必然要比你自己写的快排要快,因为你自己手写一个这么复杂的sort,那就太闲了。STL的sort是尽量让复杂度维持在O(N log N)的,因此就有了各种的Hybrid sort algorithm。 题主你提到的先quicksort到一定深度之后就转为heapsort,这种是introsort。 每种STL实现使用的算法各有不同,GNU Standard C++ Lib

STL set整理

#include<set>#include<cstdio>#include<iterator>#include<iostream>#include<algorithm>using namespace std;//set 集合的操作//multisetset<int>Set1;set<int>Set2;set<int>Set3;/*begin() 返回指向第一个元素的迭代器

【C++STL(十四)】一个哈希桶简单模拟实现unordered_map/set

目录 前言 一、改造哈希桶 改造结点类 改造主体  模板参数改造  迭代器(重点) 改造完整哈希桶 unordered_map模拟实现 unordered_set模拟实现 前言 前面的文章都有说unordered_map/set的底层结构就是哈希表,严格来说是哈希桶,那么接下来我们就尝试使用同一个哈希桶来模拟实现一下。整体的逻辑和一棵红黑树封装map/set类似,所以

STL学习之零散记录(不断更新中)

我用到什么就写什么,所以不是太注重排版,等写多了以后再整理: 1:vector<int> V,V.pop_back()弹出最后一个元素 2:优先级队列不能设置迭代器,因为没有 3:   #include <bitset> //位运算 string str2(str,0,8);//将str字符串数组截取0~7号元素,string自带的功能bitset<8>

STL源码剖析之【二分查找】

ForwardIter lower_bound(ForwardIter first, ForwardIter last,const _Tp& val)算法返回一个非递减序列[first, last)中的第一个大于等于值val的位置。      ForwardIter upper_bound(ForwardIter first, ForwardIter last, const _Tp& val

Linux下新手如何将VIM配置成C++编程环境(可以STL自动补全)

~ 弄拉老半天,终于弄的差不多啦,果然程序员还是需要有点折腾精神啊。 首先你要安装vim,命令:sudo apt-get install vim vim它只是一个编辑器,它不是IDE(比如codeblocks),IDE相当于已经给一个房子装好啦各种东西,你只要使用就行,vim却要自己装各种东西,相当于买了一个毛坯房,自己要给房子装潢。 如何安装g++编译器可以参考我上一篇博文. 1:vi