Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ...
分类:
其他好文 时间:
2014-08-10 15:23:20
阅读次数:
215
Sudoku SolverWrite a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character'.'.You may assume that the...
分类:
其他好文 时间:
2014-08-09 23:00:09
阅读次数:
269
这道题真心是难度比较大,不是算法难度,是实现难度,各种case都得考虑到。我没有A过,一开始就把.1这种case当做是错误的。导致程序逻辑乱套了。下面是别人的代码: 1 class Solution { 2 public: 3 bool isNumber(const char *s) { 4...
分类:
其他好文 时间:
2014-08-09 21:21:59
阅读次数:
347
Valid SudokuDetermine if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are ...
分类:
其他好文 时间:
2014-08-09 21:20:39
阅读次数:
226
Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another ex...
分类:
其他好文 时间:
2014-08-08 23:49:56
阅读次数:
314
Problem Description
bobo found an ancient string. The string contains only three charaters -- "(", ")" and "?".
bobo would like to replace each "?" with "(" or ")" so that the string is valid (d...
分类:
其他好文 时间:
2014-08-08 18:15:06
阅读次数:
273
题目地址:Sudoku题目大意: 一个9*9的矩阵,让你往里面填写数字,以保证每行每列以及9*9分解的9个小3*3的矩阵里 数字1-9不重复。如果有多种情况,输出其中一种即可。解题思路: 暴搜DFS。正着搜600+ms 。倒着搜0ms。 数据的原因。因为少写了一句话,让我调试了一下午。分析: 我.....
分类:
其他好文 时间:
2014-08-08 09:36:45
阅读次数:
272
很经典的问题,使用栈来解决,我这里自己实现了一个栈,当然也可以直接用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