Min Stack
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 o...
分类:
其他好文 时间:
2015-04-10 01:23:48
阅读次数:
130
题目:Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant space. You...
分类:
其他好文 时间:
2015-04-09 11:56:25
阅读次数:
148
蚂蚁问题poj1852蚂蚁问题poj1852DescriptionAn army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant re...
分类:
其他好文 时间:
2015-04-07 23:21:55
阅读次数:
181
1 integral_constant类这个类是所有traits类的基类,分别提供了以下功能:value_type 表示值的类型value表示值type 表示自己, 因此可以用::type::value来获取值true_type和false_type两个特化类用来表示bool值类型的traits,很多traits类都需要继承它们下面的代码分别来自C++11和Boost,略有差别:C++11包含va...
分类:
编程语言 时间:
2015-04-06 18:45:19
阅读次数:
298
题目:Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5...
分类:
其他好文 时间:
2015-04-05 11:50:33
阅读次数:
135
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-04-02 21:00:58
阅读次数:
104
题目:Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant space...
分类:
其他好文 时间:
2015-04-02 10:31:49
阅读次数:
114
中文乱码一般在代码里面设置编码方式,getResponse().setCharacterEncoding(Constant.CODE_UTF_8);
getRequest().setCharacterEncoding(Constant.CODE_UTF_8);但这只对post有效,对于get则需要在Web容器中配置,Tomcat配置参考:http://blog.csdn.net/calmreason...
分类:
其他好文 时间:
2015-04-01 17:38:29
阅读次数:
212
当屏幕多久没有点击的时候,进行某种操作就是所谓的锁屏功能。onCreate: public void addRunnable() { handler.postDelayed(runnable, Constant.WAIT_TIME); }监听触摸事件: @Overri...
分类:
移动开发 时间:
2015-03-31 17:56:40
阅读次数:
206
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-03-30 18:55:43
阅读次数:
104