//Stack STL
//在STL中,栈是以别的容器作为底部结构,再将
//接口改变,使之符合栈的特性
//一共5个常用操作函数 //构造析构
stack<Elem>c; //build a empty stack
stack<Elem>c1(c2); //copy a stack //5 functions
c.top(); //return the element at the top of the stack
c.push(elem); //push element at the top
c.pop(); //pop element at the top c.empty();
c.size(); //return the size of the stack //Stack is just a encapsulation of other container.
//It just supply its own interfaces.
//Elements are pushed/popped from the "back" of the specific container, which is //known as the top of the stack.

  

stack(STL)的更多相关文章

  1. C++学习注意点

    1.cin,cout关同步再用,不然效率很糟cin,cout关同步再用,不然效率很糟cin,cout关同步再用,不然效率很糟.重要的事情说三遍.关同步代码:std::ios::sync_with_st ...

  2. C语音常用库和函数

    #include <assert.h> //设定插入点 #include <ctype.h> //字符处理 #include <errno.h> //定义错误码 # ...

  3. C/C++头文件一览

    C.传统 C++ #include <assert.h> //设定插入点 #include <ctype.h> //字符处理 #include <errno.h> ...

  4. 剑指offer--面试题7

    //两个栈实现一个队列 #include<stack> //STL #include<iostream> using namespace std; template<cl ...

  5. linux常用头文件

    http://blog.csdn.net/kokodudu/article/details/17361161 aio.h 异步I/Oassert.h 验证程序断言 complex 复数类complex ...

  6. C++常用库函数

    C++常用库函数  转自:http://blog.csdn.net/sai19841003/article/details/7957115 1.常用数学函数 头文件 #include <math ...

  7. c语言_头文件

    传统 C++ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #include <assert.h> //设定插入点 #include <ctyp ...

  8. ACM在线模板

    转载自:https://blog.csdn.net/f_zyj/article/details/51594851 Index 分类细则 说起分类准则,我也是很头疼,毕竟对于很多算法,他并不是单调的,而 ...

  9. include方便查找

    #include <assert.h> //设定插入点#include <ctype.h> //字符处理#include <errno.h> //定义错误码#inc ...

随机推荐

  1. C# 语言规范_版本5.0 (第20章 附录B_语法)

    A. 语法 此附录是主文档中描述的词法和语法以及不安全代码的语法扩展的摘要.这里,各语法产生式是按它们在主文档中出现的顺序列出的. A.1 词法文法 input: input-sectionopt i ...

  2. linux的基本命令

    find: find [路径] [选项] [查找规则] [动作] -print 打印出找到的文件,以\n结束 -print0 打印出找到的文件,无换行 -exec command 对找到的文件执行命令 ...

  3. python3 流程控制

    表达式if ... else >>> if 3 > 4: ... print('False') ... else: ... print('True') ... True 表达式 ...

  4. ansible module

    模块是一个独立的, 可以复用的脚本, 它可以被anisible API, Ansible 或者ansible-playbook使用.   在模块退出之前, 它通过输出一个json字符串到标准输出从而反 ...

  5. 【转】Jmeter(三)-简单的HTTP请求(非录制)

    首先建立一个线程组(Thread Group),为什么所有的请求都要加入线程组这个组件呢?不加不行吗?答案当然是不行的.因为jmeter的所有任务都必须由线程处理,所有任务都必须在线程组下面创建. 选 ...

  6. matcaffe的blob维度顺序

    matcaffe是caffe的matlab接口.caffe本身是C++写的,其blob的维度顺序是[N,C,H,W],N表示batchSize,C表示channel数目,H表示feature map的 ...

  7. 【锋利的Jquery】读书笔记二

    一.jquery选择器 基本选择器 层次选择器 过滤选择器 基本过滤 内容过滤 可见性过滤 属性过滤 子元素过滤 first  : 获取单个元素       $("div:first&quo ...

  8. [SOJ] can I post the letter?

    1155. Can I Post the letter Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description I am a t ...

  9. 观察者模式 C++11

    #include <functional> #include <vector> #include <algorithm> #include <iostream ...

  10. 总结的OSM 地图相关的分析

    How OSM works:  Tile Format: png,  z: levels [0- 18], x: Latitude [0- ], y: Longitude [0- ];         ...