很经典的问题,使用栈来解决,我这里自己实现了一个栈,当然也可以直接用java自带的Stack类。
自己实现的栈代码:
import java.util.LinkedList;
class StackOne {
LinkedList data;
int top;
int maxSize;
StackOne(int size) {
// TODO Auto-generated co...
分类:
其他好文 时间:
2014-08-07 19:01:20
阅读次数:
236
设置方法:我的电脑->属性->高级->环境变量->系统变量中添加以下环境变量:JAVA_HOME值为:安装JDK的目录, 我的为C:\Program Files\Java\jdk1.8.0_05(安装时候有路径选择,复制下来即可)CLASSPATH值为:.;%JAVA_HOME%\lib\tools...
分类:
移动开发 时间:
2014-08-06 21:55:42
阅读次数:
371
问题:The brackets must close in the correct order,"()"and"()[]{}"are all valid but"(]"and"([)]"are not.,判断符合条件的符号([])也符合分析:遇到左边符号进栈,右边符号就将栈顶出栈,若和当前遍历的符号...
分类:
其他好文 时间:
2014-08-06 21:44:02
阅读次数:
206
Your intuition would tell you that there's a O(n) solution. Actually it is another stack-based problem to solve.class Solution {public: struct Rec ...
分类:
其他好文 时间:
2014-08-06 14:37:41
阅读次数:
186
It took me +20 submissions to get AC... Actually the statement is too vague. I would rather ask for requirements f2f.Apparently the code below can be ...
分类:
其他好文 时间:
2014-08-06 08:23:11
阅读次数:
319
题目:Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended fo...
分类:
编程语言 时间:
2014-08-06 04:10:20
阅读次数:
251
Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example: Given "25525511135",return ["25...
分类:
其他好文 时间:
2014-08-05 19:13:59
阅读次数:
225
今天码代码的时候遇到了这个问题,因为oracle用的比较少,所在查询了一下。顿时傻眼,有很多的贴子说是因为nls_date_language的问题,还要改会话级的NLS_DATE_LANGUAGE设置为简体中文,还有些别的,等等。我当时就无语了,我觉得大部分楼主都是在自己玩玩oracle的吧,虽然也算是因素,但如果是在正经项目中,谁会让你去改这种东西?!后来发现了正确的做法,如下:to_date(...
分类:
其他好文 时间:
2014-08-05 15:58:59
阅读次数:
320
problem: cvc-enumeration-valid: string value '3.0' is not a valid enumeration value for web-app-versionType in namespace http://java.sun.com/xml/ns/javaee:消息图标 - 错误 VALIDATION PROBLEMS WERE FOUND prob...
分类:
移动开发 时间:
2014-08-05 11:15:49
阅读次数:
275
如何解决No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).
错误信息
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386...
分类:
其他好文 时间:
2014-08-05 11:10:29
阅读次数:
212