码迷,mamicode.com
首页 >  
搜索关键字:pop    ( 7643个结果
在栈中增加min函数
定义栈的数据结构,要求添加一个min函数,能够得到栈的最小元素。 要求函数min、push以及pop的时间复杂度都是O(1)。 算法:在栈中设置一个辅助栈来保存最小值 代码: /** 为栈增加一个min函数,获取栈中的最小值,复杂度为1 ** author :xiaozhi xiong ** date:2014-02-08 **/ #include "stdio.h" #includ...
分类:其他好文   时间:2015-02-08 11:35:41    阅读次数:190
Git权威指南 读笔(3)
第九章 恢复进度: $ git stash list 显示存储的工作进度列表。 $ git stash 保存当前的工作进度,分别对暂存区和工作区的状态进行保存。 $ git stash pop [--index] [] 恢复保存的工作进度,并将恢复的工作进度从存储的工作进度列...
分类:其他好文   时间:2015-02-07 13:09:25    阅读次数:166
Lintcode: Implement Queue by Stacks
As the title described, you should only use two stacks to implement a queue's actions.The queue should support push(element), pop() and top() where po...
分类:其他好文   时间:2015-02-07 08:03:40    阅读次数:143
JS篇 学习笔记
API:Array.prototype.splice(start, deleteCount, value) 数组操作中有:push、pop、unshift左移出、shift左进入;splice不仅可以完成删除操作,而且还可以从中间加入:当deleteCount参数为0时就可以添加元素进来;
分类:Web程序   时间:2015-02-06 18:18:17    阅读次数:146
DrawingContext.Pop Method
The following example shows the effect of the Pop command. using System; using System.Windows; using System.Windows.Controls; using System.Windows.Med...
分类:Windows程序   时间:2015-02-06 10:48:30    阅读次数:145
Go语言标准库堆(heap)封装及堆排序实现
Go语言的OOP,接口,接口的组合,基础库的函数及接口如何抽象设计, 这些东西在Go的Heap源码及演示例子处理中,都有很好的展示. 在"container/heap"中,它的接口是如下定义的: type Interface interface { sort.Interface Push(x interface{}) // add x as element Len() Pop() interface{} // remove and return eleme...
分类:编程语言   时间:2015-02-05 16:22:40    阅读次数:262
LeetCode-Min Stack(包含min函数的栈)
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get...
分类:其他好文   时间:2015-02-05 13:46:31    阅读次数:219
8086汇编语言
一、数据传输指令───────────────────────────────────────它们在存贮器和寄存器、寄存器和输入输出端口之间传送数据.1. 通用数据传送指令.MOV 传送字或字节.MOVSX 先符号扩展,再传送.MOVZX 先零扩展,再传送.PUSH 把字压入堆栈.POP 把字弹出堆...
分类:编程语言   时间:2015-02-05 13:12:03    阅读次数:249
redis - 环境搭建(转)
一:简介(来自百科)redis是一个key-value存储系统。和Memcached类似,它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)和zset(有序集合)。这些数据类型都支持push/pop、add/remove及取交集并集和差集及更丰富的操作,...
分类:其他好文   时间:2015-02-04 16:26:51    阅读次数:153
Javascript数组函数库
其实平时用的比较多的应该是push和pop,不过还是都记下来,以便后面使用。shift:删除原数组第一项,并返回删除元素的值;如果数组为空则返回undefinedvar a = [1,2,3,4,5];var b = a.shift(); //a:[2,3,4,5] b:1unshift:将参数添加...
分类:编程语言   时间:2015-02-04 16:03:20    阅读次数:232
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!