码迷,mamicode.com
首页 >  
搜索关键字:pop    ( 7643个结果
用两个栈实现队列Java实现[剑指offer]
"题目" 用两个栈来实现一个队列,完成队列的Push和Pop操作。 队列中的元素为int类型。 题解 描述 栈的特性是先进后出,队列的特点是先进先出,当数字依次入栈1后,依次出栈1并且压入栈2后,然后再出栈的顺序与进入栈1的顺序是一致的。 因此,进入队列通过压入栈1实现,弹出队列通过弹出栈2的栈顶元 ...
分类:编程语言   时间:2019-11-12 20:20:43    阅读次数:107
LightOJ - 1148-Mad Counting (数学)
链接: https://vjudge.net/problem/LightOJ 1148 题意: Mob was hijacked by the mayor of the Town "TruthTown". Mayor wants Mob to count the total population o ...
分类:其他好文   时间:2019-11-12 13:28:08    阅读次数:70
JavaScript数组方法整理
原文链接:https://www.cnblogs.com/zyfeng/p/10541133.html 整理了以下数组方法 join() push()和pop() shift() 和 unshift() sort() reverse() concat() slice() splice() index ...
分类:编程语言   时间:2019-11-12 13:10:36    阅读次数:101
用两个栈来实现一个队列,完成队列的Push和Pop操作。
用两个栈来实现一个队列,完成队列的Push和Pop操作。队列中的元素为int类型。 1 using System.Collections.Generic; 2 namespace JianZhiOffer 3 { 4 class StackToQueue 5 { 6 Stack<int> stk1 ...
分类:其他好文   时间:2019-11-12 09:17:07    阅读次数:80
内建模块
参考: "BulidIn" 日期 Collections Hash校验 Base64 转换 struct 二进制转换 Contex Itertools ...
分类:其他好文   时间:2019-11-12 01:13:58    阅读次数:121
力扣初级算法——整数反转
实现代码: class Solution { public: int reverse(int x) { int rev=0; while(x!=0) { int pop=x%10; x=x/10; if(rev>INT_MAX/10 ||(rev==INT_MAX/10 && pop>7)) ret ...
分类:编程语言   时间:2019-11-11 21:23:27    阅读次数:174
git操作忽略.iml文件
git操作忽略.iml文件 参考: 因为.iml文件的修改导致代码pull失败 git stash: 隐藏本地修改 git pull: 拉取代码 git stash pop:将本地修改移出到工作区 参考: ...
分类:其他好文   时间:2019-11-11 12:49:19    阅读次数:774
71. 简化路径
题目描述: 以 Unix 风格给出一个文件的绝对路径,你需要简化它。或者换句话说,将其转换为规范路径。在 Unix 风格的文件系统中,一个点(.)表示当前目录本身;此外,两个点 (..) 表示将目录切换到上一级(指向父目录);两者都可以是复杂相对路径的组成部分。更多信息请参阅:Linux / Uni ...
分类:其他好文   时间:2019-11-11 12:29:26    阅读次数:92
[GXOI/GZOI2019旅行者]
``` #include #include #include #include #include #include typedef long long LL; using namespace std; const int maxn = 1e5+6,inf = 1e9; int T,n,m,k; in... ...
分类:其他好文   时间:2019-11-11 12:29:01    阅读次数:85
python中集合
去重 无序 没有索引 #remove 删除元素 >>> s1 = {1,2,3,4,5} >>> s1.remove(2) >>> print(s1) {1, 3, 4, 5} #pop 剪切 >>> s1 = {1,2,3,4,5} >>> res = s1.pop() >>> print(res ...
分类:编程语言   时间:2019-11-10 12:02:22    阅读次数:97
7643条   上一页 1 ... 94 95 96 97 98 ... 765 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!