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 andsum =...
分类:
其他好文 时间:
2014-07-02 22:10:42
阅读次数:
262
本篇文章通过按键驱动为例讲解输入子系统的开发流程。输入子系统由驱动层、输入子系统核心、事件处理层三部分组成。一个输入事件,如鼠标移动、键盘按下等通过Driver->Inputcore->Event handler->userspace的顺序到达用户控件的应用程序。用于报告EV_KEY,EV_REL,...
分类:
其他好文 时间:
2014-07-02 22:06:53
阅读次数:
175
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ...
分类:
其他好文 时间:
2014-07-02 21:13:05
阅读次数:
170
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:Failure executing javac, but could not parse the error:**.jar时出错; error in...
分类:
系统相关 时间:
2014-07-02 18:42:16
阅读次数:
276
Requirement-Driven Linux Shell ProgrammingRequirement-Driven Linux Shell ProgrammingTable of Contents1. Where can I find the basic Material about Linu...
分类:
系统相关 时间:
2014-07-02 13:55:48
阅读次数:
410
#define FIND(struc,e) (int)&(((struc *)0)->e)...
分类:
编程语言 时间:
2014-07-02 08:13:52
阅读次数:
257
题目链接:Find a Way
题目不难,前几天做,当时准备写双向BFS的,后来处理细节上出了点问题,赶上点事搁置了,今天晚上重写的,没用双向,用了两次BFS搜索,和双向BFS 道理差不多,只是这题有个小坑,需要注意
1.Y不能经过M,M不能经过Y,也就是说有Y和M的格子,可以默认为是墙
2.必须是Y和M都能到达的KFC才行,只是其中一个到达不行
例如下列数据;答案既不是22 也不...
分类:
其他好文 时间:
2014-07-02 08:13:15
阅读次数:
197
进入Ubuntu之后打开终端窗口的快捷键是:
ctrl + alt+T:通过这个命令可以打开终端。截图是:
关闭一个终端窗口的方式是:
Alt +F4,在Ubuntu下还可以是exit
对于terminal中的符号,其中的$标识,普通用户时显示的是$,超级管理员对应的符号是:#
截图如下:...
分类:
系统相关 时间:
2014-07-02 07:58:14
阅读次数:
788
Union-Find
动态连接问题描述:
给定一个n个序列的对象,有两种操作:
-Union command:连接两个对象;
-Find/connected query:两个对象是否连接(有路径)
算法实现方式
1.用一个数组保存着每个对象所在的connected component,这种方式可以快速进行FIND,但是在union操作时需要遍历整...
分类:
其他好文 时间:
2014-07-02 07:10:59
阅读次数:
287
【题目】
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.
【题意】
给定一堆点,要求找出一条之前上的最大点数
【思路】
没什么好的方法,从每个点P出发,遍历所有的情况
从每个点P出发,斜率相同的点即为统一之前上的点
注意两种特殊情况:
1. 两个点重合(即为同一个点)
...
分类:
其他好文 时间:
2014-07-02 06:52:06
阅读次数:
171