C++ Sets

集合(Set)是一种包含已排序对象的关联容器


begin()


返回指向第一个元素的迭代器


clear()


清除所有元素


count()


返回某个值元素的个数


empty()


如果集合为空,返回true


end()


返回指向最后一个元素的迭代器


equal_range()


返回集合中与给定值相等的上下限的两个迭代器


erase()


删除集合中的元素


find()


返回一个指向被查找到元素的迭代器


get_allocator()


返回集合的分配器


insert()


在集合中插入元素


lower_bound()


返回指向大于(或等于)某值的第一个元素的迭代器


key_comp()


返回一个用于元素间值比较的函数


max_size()


返回集合能容纳的元素的最大限值


rbegin()


返回指向集合中最后一个元素的反向迭代器


rend()


返回指向集合中第一个元素的反向迭代器


size()


集合中元素的数目


swap()


交换两个集合变量


upper_bound()


返回大于某个值元素的迭代器


value_comp()


返回一个用于比较元素间的值的函数

 

时间: 2024-10-06 00:16:30

C++ Sets的相关文章

Simple Automated Backups for MongoDB Replica Sets

There are a bunch of different methods you can use to back up your MongoDB data, but if you want to avoid downtime and/or potential performance degradation, the most common advice seems to be that you should simply do all your backups on a slave. Thi

The Tree-planting Day and Simple Disjoint Sets

First I have to say: I have poor English. I am too young, too simple, sometimes na?ve. It was tree-planting day two weeks ago. SHENBEN dph taught us a lot about tree-planting and the disjoint sets. It was useful and valuable for a JURUO like me. I ad

并查集 (Union-Find Sets)及其应用

定义 并查集是一种树型的数据结构,用于处理一些不相交集合(Disjoint Sets)的合并及查询问题.常常在使用中以森林来表示. 集就是让每个元素构成一个单元素的集合,也就是按一定顺序将属于同一组的元素所在的集合合并. 主要操作 初始化 把每个点所在集合初始化为其自身. 通常来说,这个步骤在每次使用该数据结构时只需要执行一次,无论何种实现方式,时间复杂度均为O(N). 查找 查找元素所在的集合,即根节点. 合并 将两个元素所在的集合合并为一个集合. 通常来说,合并之前,应先判断两个元素是否属于

hdu 3836 Equivalent Sets【强联通】

Equivalent Sets Time Limit: 12000/4000 MS (Java/Others)    Memory Limit: 104857/104857 K (Java/Others) Total Submission(s): 3065    Accepted Submission(s): 1077 Problem Description To prove two sets A and B are equivalent, we can first prove A is a s

UVA 11488 Hyper Prefix Sets (Trie)

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2483 Hyper Prefix Sets Prefix goodness of a set string islength of longest common prefix*number of strings in the set.For example the prefix goodnes

Terrible Sets

Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 3017   Accepted: 1561 Description Let N be the set of all natural numbers {0 , 1 , 2 , . . . }, and R be the set of all real numbers. wi, hi for i = 1 . . . n are some elements in N, and w0

[转]SSIS Execute SQL Task : Mapping Parameters And Result Sets

本文转自:http://www.programmersedge.com/post/2013/03/05/ssis-execute-sql-task-mapping-parameters-and-result-sets.aspx#.U18_6PmSxBk A very common scenario in an ETL process is one in which you need to call out to some configuration tables to figure out so

cf468B Two Sets

Little X has n distinct integers: p1,?p2,?...,?pn. He wants to divide all of them into two sets A and B. The following two conditions must be satisfied: If number x belongs to set A, then number a?-?x must also belong to set A. If number x belongs to

MongoDB设置 Replication Sets

MongoDB 高可用可用分两种 : Master-Slave 主从复制 :只需要在某一个服务启动时加上–master 参数, 而另一个服务加上–slave 与–source 参数, 即可实现同步. MongoDB的最新版本已不再推荐此方案. Replica Sets 复制集 :MongoDB 在 1.6 版本对开发了新功能 replica set,这比之前的 replication 功能要强大一 些,增加了故障自动切换 和自动修复成员节点,各个 DB 之间数据完全一致,大大降低了维 护成功.a

Generating Sets 贪心

H - Generating Sets Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Description You are given a set Y of ndistinct positive integers y1,?y2,?...,?yn. Set X of ndistinct positive integers x1,?x2,?...,?xn is