Valid ParenthesesTotal Accepted:47887Total Submissions:180550My SubmissionsQuestionSolutionGiven a string containing just the characters'(',')','{','}...
分类:
其他好文 时间:
2015-04-20 12:59:20
阅读次数:
85
1. Valid Parentheses
用来判断字符串中的括号是否合法的一道题。注意输入只会有 (, ) , {, }, [, ]这么几种情况。
合法的括号是以一定的顺序进行匹配的一些。比如:"()[]', 或者"([])"等,而以"([)]"这种为类型的表示是有错误的。
很显然用“stack”来作为数据结构来实现这道题,每一次插入一个元素的时候都进行匹配,如果匹配成功了,那么就将栈顶元素...
分类:
编程语言 时间:
2015-04-20 11:14:24
阅读次数:
138
我们为什么用触发器呢?
下面摘自部分官方文档:Automatically generate virtual column values(自动生成虚拟列值)
Log events(日志事件)Gather
statistics on table access(收集统计数据表的访问)
Modify table data when DML statements are issued agains...
分类:
其他好文 时间:
2015-04-20 09:39:58
阅读次数:
200
题目描述Given numRows, generate the first numRows of Pascal’s triangle.For example, given numRows = 5,
Return
从第三行开始,每行除了最左边和最右边两个数为1,其他数字都是上一行中相邻两个数字之和。根据上述规则可以写出下面的代码:class Solution {
public:
vecto...
分类:
其他好文 时间:
2015-04-18 23:49:45
阅读次数:
341
https://leetcode.com/problems/unique-binary-search-trees-ii/Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n...
分类:
其他好文 时间:
2015-04-18 23:18:39
阅读次数:
122
想清楚了,安排好细节不难public class Solution { public ArrayList> generate(int numRows) { ArrayList> res = new ArrayList>(); if(numRows tmp = new...
分类:
其他好文 时间:
2015-04-18 06:25:25
阅读次数:
149
GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]...
分类:
其他好文 时间:
2015-04-17 21:51:24
阅读次数:
142
题目:Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the long...
分类:
其他好文 时间:
2015-04-17 17:52:17
阅读次数:
118
启动Android studio 1.点击菜单栏Build -> Generate Signed APK...,打开如下窗口 2.这里是类似eclipse中Android的签名,假设这里没有打过apk包,没有签名,那么点击Create new,窗口如下 这里只要输入几个必要项 Key store p...
分类:
移动开发 时间:
2015-04-17 13:39:37
阅读次数:
144
题目:Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the corre...
分类:
其他好文 时间:
2015-04-17 13:33:47
阅读次数:
82