当前位置:网站首页>STL application (unfinished
STL application (unfinished
2022-06-11 19:33:00 【*c.】
Catalog
Container general functions :
.size() The number of elements in the container
.empty() Judge whether the container is empty Return to one bool value (true/fault)
.front() Returns the first element of the container
.back() Returns the last element of the container
.begin() Pointer to the first element of the container
.end() Pointer to the next position of the last element of the container
.swap(b) Exchange the contents of two containers
::iterator() iterator
An iterator is a generalized pointer , It could be a pointer , It can also be an object that performs a pointer like operation on it. You can use an iterator to output vector The elements in :
for(vector<int>::interator it=a.begin();it!=a.end();it++) cout<<*it<<endl;
vector( vector ) Basics :
Constructors :
a = vector(int) // Create an empty vector a,int type , The array name is a
a = vector(b) // copy constructor , Create a and b The same vector a Create a 2D array :vector<int>a[5] It's equivalent to creating 5 individual vector Each is an array
Additive elements :
a.push_back(x) // To vector a Add an element to the tail X
a.insert(it, x) // To vector a Iterators in it Add elements in front X
Remove elements :
a.pop_back() // Delete vector a The last element in
a.clear() // Empty vector a All elements in
a.erase(it) // Delete vector a Iterators in it Pointing elements
Get elements :
a.front() // Get vector a The head element of
a.back() // Get vector a The tail element of
Acquisition iterator
a.begin() // Get vector a Iterator for the head of
a.end() // Get vector a Iterator of tail
Get vector information
a.empty() // Judgment vector a Is it empty
a.size() // Judgment vector a Size
stack Basics
.stack<int>s Create a stack The type is int type
.push(x) x Push
.pop() Stack top exit
.top() Reference the top of the stack
.empty() Is the stack empty If it is empty, return to true
.size() Stack size Returns the number of elements in the stack
边栏推荐
- Lecture 30 linear algebra Lecture 2 Matrix
- [image denoising] image denoising based on Markov random field with matlab code
- Practice of Flink CDC in Dajian cloud warehouse
- PyMySQL利用游标操作数据库方法封装!!!
- 程序员10年巨变,一切都变了又好像没变...
- 【C语言刷题——Leetcode10道简单题】
- [signal denoising] speech adaptive denoising based on nonlinear filter with matlab code
- AHB2APB_bridge 设计
- Template and requirements of curriculum design of reinforced concrete structure in autumn 21 of Dagong [standard answer]
- postman配置中文
猜你喜欢
![[signal denoising] signal denoising based on FFT and fir with matlab code](/img/4c/782afe2652a674d64fccd8d28304ed.png)
[signal denoising] signal denoising based on FFT and fir with matlab code

30讲 线性代数第二讲 矩阵

highcharts设置柱状图宽度、渐变、圆角、柱子上方数据
![[image denoising] impulse noise image denoising based on absolute difference median filter, weighted median filter and improved weighted median filter with matlab code attached](/img/dc/6348cb17ca91afe39381a9b3eb54e6.png)
[image denoising] impulse noise image denoising based on absolute difference median filter, weighted median filter and improved weighted median filter with matlab code attached

RTL仲裁器设计

Find the maximum 3 same digits in the string

Yolov3 pytoch code and principle analysis (I): runthrough code

电子商务(njupt)

2022 the latest software testing classic summarized by major manufacturers. After reading it, I'm not afraid I won't get an offer

Qubicle notes: self set shortcut keys (attached with Lao Wang's self set shortcut key file)
随机推荐
SLAM APP
Postman configuration Chinese
APB2standard_handshake_bridge 设计
【求助】请问如何让微信公众号文章在外部浏览器中打开后还能显示下方的精选留言?
谷歌提出超强预训练模型CoCa,在ImageNet上微调Top-1准确率达91%!在多个下游任务上SOTA!...
【Multisim仿真】利用运算放大器产生锯齿波
Internet_ Business Analysis Overview
Introduction to typescript
ASEMI的MOS管25N120在不同应用场景的表现
Cf:f. shifting string [string rearrangement in specified order + grouping into rings (cutting connected components) + minimum same moving cycle of each group + minimum common multiple]
[signal denoising] signal denoising based on FFT and fir with matlab code
Multimodal learning toolkit paddlemm based on propeller
AHB2APB_bridge 设计
Flutter--Button浅谈
Database design graduation information management
AHB2Standard_handshake_bridge 设计
Use Mysql to determine the day of the week
Performance of MOS transistor 25n120 of asemi in different application scenarios
【C语言刷题——Leetcode10道简单题】
【Multisim仿真】利用运算放大器产生方波、三角波发生器