博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
c++ stl stack_C ++ STL中的stack :: top()函数
阅读量:2531 次
发布时间:2019-05-11

本文共 1262 字,大约阅读时间需要 4 分钟。

c++ stl stack

Prototype:

原型:

stack
st; //declaration T st.top();

Parameter:

参数:

No parameter passed

Return type: T //data type

返回类型: T //数据类型

Header file to be included:

包含的头文件:

#include 
#include
OR #include

Usage:

用法:

The function returns the current top element of a stack. (no change in stack status)

该函数返回堆栈的当前顶部元素。 (堆栈状态不变)

Time complexity: O(1)

时间复杂度:O(1)

Example:

例:

For a stack of integer,    stack
st; st.push(4); st.push(5); stack content: 5 C++ implementation: Output ...use of top function...stack elements are:top element is:6top element is:5top element is:4stack empty3 pop operation performed total to make stack empty
TOP Interview Coding Problems/Challenges
Comments and Discussions
Ad:Are you a blogger? Join our .
Please enable JavaScript to view the

翻译自:

c++ stl stack

转载地址:http://cvtzd.baihongyu.com/

你可能感兴趣的文章
机器学习基石笔记2——在何时可以使用机器学习(2)
查看>>
POJ 3740 Easy Finding (DLX模板)
查看>>
MySQL 处理重复数据
查看>>
关于typedef的用法总结(转)
查看>>
hibernate could not resolve property
查看>>
【strtok()】——分割字符串
查看>>
Linux下安装rabbitmq
查看>>
曹德旺
查看>>
【转】判断点在多边形内(matlab)
查看>>
java基础之集合:List Set Map的概述以及使用场景
查看>>
Python 线程 进程 协程
查看>>
骨牌覆盖问题
查看>>
iOS语言中的KVO机制
查看>>
excel第一次打开报错 向程序发送命令时出错 多种解决办法含终极解决方法
查看>>
响应式web设计之CSS3 Media Queries
查看>>
实验三
查看>>
机器码和字节码
查看>>
环形菜单的实现
查看>>
Python 函数参数 传引用还是传值
查看>>
【解决Chrome浏览器和IE浏览器上传附件兼容的问题 -- Chrome关闭flash后,uploadify插件不可用的解决办法】...
查看>>