当前位置:网站首页>Conteneur STL set
Conteneur STL set
2022-07-24 03:23:00 【Joker 0030】
#include <set>
#include <string>
#include<iostream>
using namespace std;
int main()
{
set<string> db;
db.insert(string("abs"));
db.insert(string("abd"));
db.insert(string("abe"));
db.insert(string("abc"));
db.insert(string("aba"));
//Supprimer.
db.erase(string("abe"));
//db.erase("abe");
//Sortie de l'Itérateur
set<string>::iterator ite = db.begin();
for ( ite; ite !=db.end(); ite++)
{
cout << *ite<<endl;
}
system("pause");
return 0;
}
set:
1、Enregistrement des mots clés:Trier par valeur réelle,Trouver par les valeurs réelles;
Caractéristiques:a、 Accès efficace ,Comparermap:
1、 La structure des données est rouge et noir ;
2、map C'est une paire de touches ,set La valeur clé est la valeur réelle , La valeur réelle est la valeur clé .
b、Les valeurs clés ne peuvent pas être répétées.
2、Arbre Rouge et noir(Équilibre Trier les arbres binaires):x=log2^N:
a、N Est la quantité totale de données .
b、x Est le nombre de recherches ,2^x>=N.
3、 La valeur de la clé ne peut pas être modifiée , La valeur réelle peut être modifiée . Mais en général, la modification de la valeur réelle signifie que la modification de la valeur de la clé modifiera toute la structure , Les modifications ne sont généralement pas recommandées .
4、Pas de capacité; Obtenez le nombre d'éléments ,size(),Taille; Obtenir si un élément existe , Ou déterminer si un élément existe , count(const key&_key);Juge si c'est videempty(),Retour vide1,Retour non vide0;Itérateur,Peut circuler、 Vous pouvez aussi ajouter ++,Mais non+2.
边栏推荐
- [C language] file operation
- Simulink代码生成: 可变子系统及其代码
- Regular expression \b \b understand word boundary matching in simple terms
- Advantages, disadvantages and summary of sequence list and linked list
- Babylon.js cool canvas background animation JS special effects
- Services et configurations FTP
- uva1445
- MySQL学习——MySQL软件的安装及环境配置(Windows)详细!
- [super complete sorting] Cisco and Huawei order comparison memo, take it away without thanks! Anytime, anywhere
- Android Development - lambda expression of kotlin syntax
猜你喜欢

322. Change

Some properties of differential array operation

What is the experience of writing concurrent tool classes (semaphore, cyclicbarrier, countdownlatch) by yourself in line 30?

The first edition of Niuke brush question series (automorphic number, return the number of prime numbers less than N, and the first character only appears once)

FTP服务与配置

MySQL sub database and sub table and its smooth expansion scheme

Programmers may still be programmers, and coders may only be coders

What is IMU?

Basic syntax of MySQL DDL and DML and DQL

In the future, when the interviewer asks why you don't recommend using select *, please answer him loudly!
随机推荐
Unity Message push
Cannot resolve symbol 'override' of idea clone‘
Services et configurations FTP
Write code, and multiple characters move from both ends to converge in the middle
移动通信的新定义:R&SCMX500 将提高5G设备的IP数据吞吐量
Unity 消息推送
Application of motion capture in automatic control field
A series of problems of dp+ backtracking segmentation palindrome string
CMT 注册——Google Scholar Id,Semantic Scholar Id,和 DBLP Id
B. Eastern Exhibition- Codeforces Round #703 (Div. 2)
Gpushare. COM | how to use tensorboardx visualization tool?
What is the experience of writing concurrent tool classes (semaphore, cyclicbarrier, countdownlatch) by yourself in line 30?
关于Aries框架增删改查-查Demo
SolidWorks CAM data cannot be recovered because a processed part has been detected.
leetcode hot 100(刷题篇8)(232/88/451/offer10/offer22/344/)
21st day of written test mandatory training
Lagrange polynomial
A simple and perfect WPF management system framework source code
Jump statements break and continue
Ways to improve the utilization of openeuler resources 01: Introduction