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-12-17 14:44:41
阅读次数:
191
题意:
给n个人和一些认识关系,要将这n个人分成两队,每队的人之间都互相认识,求一种方案使两队的人数差最小。
分析:
对原图求逆得到新图g,g中如果有边(a,b),那么a,b不能在一个队,对新图进行二分图染色就能求得一种方案了。但题目要使人数差最小,所以还要dp一下。dp[i][j]表示前i个连通分量获得j个人的队伍是否可行,这其实是个背包问题,每个物品有多种重量,问是否能获得一个特定的重量...
分类:
其他好文 时间:
2014-12-17 14:43:23
阅读次数:
126
相信很多人都用过利用border来实现小三角箭头,百度一下,这类的文章多如牛毛,这里我还是啰嗦点把常用的方法陈列出来:.triangle_border_up{ width:0; height:0; border-width:0 30px 30px; border-style:...
分类:
Web程序 时间:
2014-12-17 14:24:56
阅读次数:
147
A simple controller
控制器程序读取传感器的值,然后修改行走速度来避开障碍物。
下面是控制器源代码mybot_simple.c:
#include
#include
#include
#define SPEED 60
#define TIME_STEP 64
int main()
{
wb_robot_init();//初始化webots
//获取并使能距离传感器...
分类:
Web程序 时间:
2014-12-17 12:48:51
阅读次数:
214
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree {3,9,20,#,#,15,7},
...
分类:
其他好文 时间:
2014-12-17 09:50:15
阅读次数:
169
These are some tutorials i've written to get people started with android cracking.way of the android cracker 0this covers the essentials of setting up...
分类:
移动开发 时间:
2014-12-17 09:06:14
阅读次数:
151
Django 1.5 documentationHome|Table of contents|Index|Modules«previous|up|next»如何安装 Django本文档将指导你安装及运行 Django 框架。安装 Python作为一个 Python Web 框架,Django 是需要...
分类:
其他好文 时间:
2014-12-17 01:35:48
阅读次数:
283
总结一个在C#中如何使用资源的方法:一:使用本地文件1、将本地要加入的资源文本(视频,图片,文本或其它)加入项目,比如我们现在加入一个up.bmp的图片到项目中,且放在文件夹Resources下面,2、将up.bmp的生成操作设置为"嵌入的资源"3、读取资源:Assembly assembly = ...
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/41964067
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root)....
分类:
其他好文 时间:
2014-12-16 21:07:59
阅读次数:
207
#coding=utf-8
?
from?ftplib?import?FTP
import?os
import?os.path
import?shutil
import?datetime
?
def?ftp_up(filename):
????ftp=FTP()?
????ftp.set_debuglevel(2)#打开调试级别2,显示...
分类:
编程语言 时间:
2014-12-16 19:35:19
阅读次数:
158