码迷,mamicode.com
首页 >  
搜索关键字:peek    ( 239个结果
[LeetCode]155 Min Stack
https://oj.leetcode.com/problems/min-stack/http://blog.csdn.net/linhuanmars/article/details/41008731classMinStack{ publicvoidpush(intx){ data.push(x); if(min.empty()||(x<=(int)min.peek())) { min.push(x); } } publicvoidpop(){ if(data.empty()) return; in..
分类:其他好文   时间:2015-01-09 19:35:38    阅读次数:146
如何理解栈(栈的实现方式)
网上看到的一段对话,写的很清晰,一目了然。Frank: 什么是栈?Linda: 它是一种数据结构,按先进后出(或后进先出)的方式收集对象。它通常有一个 API,其中包括push()和pop()等方法。有时也有peek()方法。Frank:push()有什么功能?Linda:push()接受一个输入对...
分类:其他好文   时间:2015-01-05 11:05:56    阅读次数:132
2014-12-19 特殊集合:stack、queue、Hashtable
//特殊集合,栈 stack Stack ss = new Stack(); ss.Push(3); //向栈中插入3 Console.WriteLine(ss.Peek()); //返回最后一个进入栈的元素 Console.WriteLine(ss.Pop()); //返回并移除最后一个进入栈的元...
分类:其他好文   时间:2014-12-23 10:25:26    阅读次数:188
11、C#基础整理(特殊集合和哈希表)
特殊集合:队列、栈一、栈Stack类:先进后出,没有索引Stack ss = new Stack();1、增加数据:push :将元素推入集合ss.Push(3);ss.Push(5);ss.Push(7);2、获取数据:(1)peek返回位于stack顶部的对象但不移除(获取最后一个进入的元素的值...
分类:Windows程序   时间:2014-12-18 21:50:46    阅读次数:221
careercup-栈与队列 3.6
3.6 编写程序,按升序对栈进行排序(即最大元素位于栈顶)。最多只能使用一个额外的栈存放临时数据,但不得将元素复制到别的数据结构中(如数组)。该栈支持如下操作:push、pop、peek和isEmpty。解答使用一个附加的栈来模拟插入排序。将原栈中的数据依次出栈与附加栈中的栈顶元素比较, 如果附加栈...
分类:其他好文   时间:2014-12-04 21:27:28    阅读次数:185
OLE/COM Object Viewer
OLE/COM Object Viewer摘AutoIt HelpThe "OLE/COM Object Viewer" is a very handy tool to get a peek on all COM objects currently installed on your system....
分类:其他好文   时间:2014-12-01 15:43:49    阅读次数:778
CC150 3.6
3.6Writeaprogramtosortastackinascendingorder.Youshouldnotmakeanyassumptionsabouthowthestackisimplemented.Thefollowingaretheonlyfunctionsthatshouldbeusedtowritethisprogram:push|pop|peek|isEmpty.interfaceStack<T> { push(Tt); Tpop(); Tpeek(); booleanisEm..
分类:其他好文   时间:2014-11-27 08:02:46    阅读次数:156
Valid Parentheses——括号匹配算法
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/41450987 本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/41450987 通过本文你能学到如下知识: (1)对数据结构中栈的理解,特别是Stack类中的peek()方法和pop()方法的区别。 (2)理解解题思路,提高思考问题的能力。 Given a string co...
分类:编程语言   时间:2014-11-24 22:40:46    阅读次数:257
CC150 3.2
3.2Howwouldyoudesignastackwhich,inadditiontopushandpop,alsohasafunctionminwhichreturnstheminimumelement?Push,popandminshouldalloperateinO(1)time.Useanotherstackmaintainingmin. push(Tt) { mainStack.push(t); TcurMin=minStack.peek(); if(curMin==null||t<curM..
分类:其他好文   时间:2014-11-24 12:08:38    阅读次数:183
linux记录键盘
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 static struct termios initial_settings,new_settings; 9 static int peek....
分类:系统相关   时间:2014-11-16 17:14:24    阅读次数:135
239条   上一页 1 ... 21 22 23 24 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!