题目链接Givennpairs of parentheses, write a function to
generate all combinations of well-formed parentheses.For example, givenn= 3, a
solution set is:"((...
分类:
其他好文 时间:
2014-06-09 15:11:33
阅读次数:
212
同是递归简单题public class Solution { public boolean
isSameTree(TreeNode p, TreeNode q) { boolean flag = true; if(p == null
&& q == null) ...
分类:
其他好文 时间:
2014-06-09 13:46:23
阅读次数:
275
如果是全新安装应该就不会出现这个问题,升级安装的话,要运行mysql_upgrade
,但是启动MYSQL就报错MySQL Daemon failed to
start如此就没办法运行mysql_upgrade升级MYSQL表了因为是全新安装的数据库服务器就不管老数据了,直接把老的MYSQL数据库文...
分类:
数据库 时间:
2014-06-08 21:41:49
阅读次数:
420
第一种方法,暴力求解,从当前向左右两个方向扫描比自己小的,然后计算面积,时间复杂度O(n^2)code如下,但是在LeetCode上回超时。
1 class Solution { 2 public: 3 int largestRectangleArea(vector &height) {
4...
分类:
其他好文 时间:
2014-06-08 21:24:07
阅读次数:
328
【题目】
Follow up for problem "Populating Next Right Pointers in Each Node".
What if the given tree could be any binary tree? Would your previous solution still work?
Note:
You may only use constant extra space.
For example,
Given the following binary tre...
分类:
其他好文 时间:
2014-06-08 15:46:22
阅读次数:
303
题目
Two elements of a binary search tree (BST) are swapped by mistake.
Recover the tree without changing its structure.
Note:
A solution using O(n)
space is pretty straight forward. Cou...
分类:
其他好文 时间:
2014-06-08 15:32:45
阅读次数:
245
Oralce升级过程中,执行SQL> @?/rdbms/admin/catupgrd.sql脚本时,
遇到ORA-01722: invalid number报错,
导致报错的语句是 SELECT TO_NUMBER('DATA_VAULT_OPTION_ON') FROM v$option。
解决方法: 关闭Oracle Database Vault功能。...
分类:
数据库 时间:
2014-06-08 09:08:07
阅读次数:
251
题目
Given a collection of integers that might contain duplicates, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not c...
分类:
其他好文 时间:
2014-06-08 05:32:21
阅读次数:
196
题目
Given a set of distinct integers, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.
...
分类:
其他好文 时间:
2014-06-08 04:01:05
阅读次数:
240
Implement wildcard pattern matching with support for '?' and '*'.public class Solution {
public boolean isMatch(String s, String p) {
if (s == null || p == null) return false;
if (...
分类:
编程语言 时间:
2014-06-08 03:10:46
阅读次数:
216