假如有两个ViewController: A 和 B(使用了UINavigationController), 在B中有一个TextField, 一个Button.(在ARC模式下) 在Button调用的方法中创建一个UIAlertView, 在AlertView的代理方法clickedButtonA...
分类:
其他好文 时间:
2015-07-29 15:41:58
阅读次数:
165
1、redis简介redis是一个key-value存储系统。和Memcached类似,它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)、zset(sorted set --有序集合)和hashs(哈希类型)。这些数据类型都支持push/pop、add...
Design a stack that supports push, pop, top, and retrieving(检索) the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Rem...
分类:
其他好文 时间:
2015-07-29 00:39:03
阅读次数:
130
#include
using namespace std;
template
struct tcontainer
{
virtual void push(const t&) = 0;
virtual void pop() = 0;
virtual const t& begin() = 0;
virtual const t& end() = 0;
virtual size_t si...
分类:
其他好文 时间:
2015-07-28 21:17:50
阅读次数:
177
STL 中优先队列的使用方法(priority_queu)
基本操作:
empty() 如果队列为空返回真
pop() 删除对顶元素
push() 加入一个元素
size() 返回优先队列中拥有的元素个数
top() 返回优先队列对顶元素
在默认的优先队列中,优先级高的先出队。在默认的int型中先出队的为较大的数。
使用方法:
头文件:
#include
声...
分类:
其他好文 时间:
2015-07-28 18:53:33
阅读次数:
90
输入两个整数序列。其中一个序列表示栈的push顺序,判断另一个序列有没有可能是对应的pop顺序。为了简单起见,我们假设push序列的任意两个整数都是不相等的。 比如输入的push序列是1、2、3、4、5,那么4、5、3、2、1就有可能是一个pop系列。因为可以有如下的push和pop序列:push....
分类:
其他好文 时间:
2015-07-27 20:22:49
阅读次数:
98
Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the top element.empty() -- Return whether...
分类:
其他好文 时间:
2015-07-27 19:07:07
阅读次数:
87
项目要实现从一个Navigation 下push出的第N层controller后 立即切换到另一个 Navigation下例如:在微信的通讯录Nav中选择一个好友,进入好友的详细资料,点击发消息按钮后,进入聊天界面,这时你会发现点击左上返回按钮后pop到的时微信Nav,(另一个NavigationC...
分类:
其他好文 时间:
2015-07-27 13:07:34
阅读次数:
431
http://www.cnblogs.com/flyoung2008/articles/2136485.htmlpriority_queue调用 STL里面的 make_heap(), pop_heap(), push_heap() 算法实现,也算是堆的另外一种形式。先写一个用 STL 里面堆算法实...
分类:
其他好文 时间:
2015-07-27 13:04:08
阅读次数:
91
http://www.cnblogs.com/void/archive/2012/02/01/2335224.html优先队列是队列的一种,不过它可以按照自定义的一种方式(数据的优先级)来对队列中的数据进行动态的排序每次的push和pop操作,队列都会动态的调整,以达到我们预期的方式来存储。例如:我...
分类:
其他好文 时间:
2015-07-27 12:54:55
阅读次数:
119