Given a binary tree and a sum, find all root-to-leaf paths where each path's
sum equals the given sum.
For example:
Given the below binary tree and
sum = 22,
5
...
分类:
其他好文 时间:
2014-06-15 19:55:39
阅读次数:
191
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.
For example:
Given the below binary tree and sum
...
分类:
其他好文 时间:
2014-06-15 19:26:23
阅读次数:
207
php基本的语法网上看一些别人写的网站就会了)
php下的执行sql语句:
1.建立数据库连接:
$conn = mysql_connect("localhost", "root", "admin") or die("Could not connect " );
Localhost:本地主机名,root:mysql数据库账号 admin:mysql数据库密码
my...
分类:
编程语言 时间:
2014-06-15 19:17:52
阅读次数:
298
su命令和su -命令最大的本质区别就是:
su只是切换了root身份,但Shell环境仍然是普通用户的Shell;
而su -连用户和Shell环境一起切换成root身份了。
只有切换了Shell环境才不会出现PATH环境变量错误。su切换成root用户以后,pwd一下,发现工作目录仍然是普通用户的工作目录;
而用su -命令切换以后,工作目录变成root的工作目录了。用echo $PA...
分类:
系统相关 时间:
2014-06-15 18:52:12
阅读次数:
268
需求: 在tmux里面链接ssh的时候, 如果存在多个ssh主机, 想要显示对应的主机ip以示甄别
实现效果
编辑你的bashrc, 因为我习惯在root下操作, 所以/root/.bashrc, 你如果习惯用user, 那就编辑/home/你的用户名/.bashrc
增加
ssh() {
if [ "$(ps -p $(ps -p $$ -o...
分类:
其他好文 时间:
2014-06-15 17:58:18
阅读次数:
245
1、Every object in a state of uniform motion tends to remain in that state of motion unless an external force is applied to it.无外力的作用下,物体静态
2.The relationship between an object's mass m,it's accelerat...
分类:
其他好文 时间:
2014-06-15 16:46:22
阅读次数:
304
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
此题和求二叉树的最短路径几乎一模一样。
public int...
分类:
其他好文 时间:
2014-06-15 16:36:40
阅读次数:
209
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.
For example:
Given the below bin...
分类:
其他好文 时间:
2014-06-15 09:34:35
阅读次数:
226
题目链接:
http://poj.org/problem?id=1573
题目:
Robot Motion
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 10202
Accepted: 4971
Description
A robot h...
分类:
其他好文 时间:
2014-06-14 07:44:51
阅读次数:
244