问题:罗马数字变为整数class Solution {public: int romanToInt(string s) { char c[10][10][10]={{"0","I","II","III","IV","V","VI","VII","VIII","IX"},{"0"...
分类:
其他好文 时间:
2014-08-01 23:01:02
阅读次数:
209
描述:注意需要先self.connect(right)再self.connect(left),否则会有case通不过,原因是左边递归执行时依赖与右边的next已经建立,而先执行connect(left)的话右边还没有完成关系的建立。代码: 1 class Solution: 2 # @par...
分类:
其他好文 时间:
2014-08-01 19:15:42
阅读次数:
223
这道题实质是用螺旋线的形式遍历二维数组,而且这种遍历方式有很强的规律性,从最外层开始一直到最里层,而且每层都按顺时针的方向遍历。根据这种规律性,我们可以用两层循环,在遍历的同时对二维数组对应元素重新赋值,第一层循环是层数遍历,第二层循环是每一层元素遍历(值得注意的一点是顺时针遍历)。class So...
分类:
其他好文 时间:
2014-08-01 18:54:02
阅读次数:
217
class Solution {public: int totalNQueens(int n) { //initialize chessboard vector> boardconf; vector orig_row; orig_row....
分类:
编程语言 时间:
2014-08-01 15:46:51
阅读次数:
251
Greedy, Greedy, Greedy.. It is all about maximum interval update.One trick is, we start looping over each element from the one nearest to end to farth...
分类:
其他好文 时间:
2014-08-01 13:32:21
阅读次数:
283
问题:将数字转化为罗马数字分析:将所有的数字打表出来class Solution {public: string intToRoman(int num) { char c[10][10][10]={{"0","I","II","III","IV","V","VI","VII","...
分类:
其他好文 时间:
2014-08-01 10:32:21
阅读次数:
215
题目: Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example,Given n = 3, your program should return....
分类:
编程语言 时间:
2014-08-01 04:53:31
阅读次数:
279
选择Nios II Library选择location,这样的话库文件时独立的,而如果选择 Make library depend on a BSP的话会依赖BSP,如果BSP被删除了那新工程编译时会报错。添加c源文件和h头文件然后build project然后新建工程:file->Nios II ...
分类:
移动开发 时间:
2014-07-31 16:17:47
阅读次数:
342
思路:统计每位出现的次数,mod3;对于k同样适用 1 class Solution { 2 public: 3 int singleNumber(int A[], int n) { 4 int a[32] = {0}; 5 int i = 0; 6 ...
分类:
其他好文 时间:
2014-07-31 13:14:46
阅读次数:
140
Warning (15714): Some pins have incomplete I/O assignments. Refer to the I/O Assignment Warnings report for details解释:后续高级的芯片的 drive strength 和 slew r...
分类:
其他好文 时间:
2014-07-31 12:22:26
阅读次数:
320