Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:
其他好文 时间:
2015-02-15 14:54:50
阅读次数:
165
解释一下Linux上free命令的输出。 下面是free的运行结果,一共有4行。为了方便说明,我加上了列号。这样可以把free的输出看成一个二维数组FO(Free Output)。例如: FO[2][1] = 15402628 FO[3][2] =12033012 free的...
分类:
系统相关 时间:
2015-02-12 18:20:52
阅读次数:
268
想要在shell中调用python脚本时实现:1 python pyServer.py argu1 argu2 argu3利用 sys.argv 即可读取到 相应参数:1 # coding=utf-82 import sys3 4 if __name__ == '__main__':5 fo...
分类:
编程语言 时间:
2015-02-11 12:32:31
阅读次数:
183
The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo...
分类:
其他好文 时间:
2015-02-10 15:12:10
阅读次数:
138
Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.Fo...
分类:
移动开发 时间:
2015-02-10 15:00:46
阅读次数:
202
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-02-10 14:51:13
阅读次数:
151
若存在特殊字符用此方法,效率高,若不存在就用replacepublic static String repStr(String str) { if(str == null) { return null; } char[] array = str.toCharArray(); fo...
分类:
其他好文 时间:
2015-02-08 14:02:32
阅读次数:
134
重写规则为什么要options +followsymlinks Web服务器的Apache安装编译成功mod_rewrite编译成模块,但当我在网站根目录下放了一个.htaccess配置文件,却得到了一个500内部服务器出错。我打开我的.htaccess配置文件,发现文件头有 Options +Fo...
分类:
其他好文 时间:
2015-02-08 06:43:13
阅读次数:
148
位运算优先级:~>&^|常用运算:置位(set bit)将第bit位置为1A |= 1>bit&1)!=0取最后一个非0位A&-A 原理是:A=0000 0100 -A是将A按位取反然后+1,那么就相当于以最后一个1为分界线,左边全部取反,分界线及其往右是不变的A&((~A)+1)统计非0位fo.....
分类:
其他好文 时间:
2015-02-06 16:43:13
阅读次数:
126
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:
其他好文 时间:
2015-02-05 23:15:41
阅读次数:
191