Given a binary tree, findits maximum depth.
The maximum depth is thenumber of nodes along the longest path from the root node down to the farthestleaf node.
可用递归,效率低。
这里用类似层次遍历的算法。设置一个队列和两个int变量...
分类:
其他好文 时间:
2015-01-30 09:10:56
阅读次数:
261
题目:
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
The robot can only move either down or right at any point in time. The robot is trying to r...
分类:
其他好文 时间:
2015-01-29 19:42:21
阅读次数:
206
流媒体服开发的时候常用的两个工具,
1. MediaInfo
下载路径:(http://w.x.baidu.com/alading/anquan_soft_down_all/11027)
工具说明:可以查看视频、图片文件的文件信息,包含编码、文件格式等多个属性使用也很方便,安装后直接右键点击选择要查看的文件即可:
图片:
视频:
...
分类:
Web程序 时间:
2015-01-29 10:37:07
阅读次数:
157
public class MainActivity extends Activity {
protected static final int DOWN = 0;
protected static final int SEER = 1;
private Context context;
private EditText ed;
private Pr...
分类:
移动开发 时间:
2015-01-29 09:28:57
阅读次数:
163
有时候,看到一些界面上的色彩,心情可能会很舒畅,有时候,看到一些其他色彩,就觉得很讨厌,垃圾,看到android L Palette 从图片中提取筛选出来的颜色,我就觉得都挺好看的,也就去了解了下Palette的实现原理。
看了代码,大概说说主要的步骤:
第一步,将图片缩小,相当于降低计算量和减少内存的使用
/**
* Scale the bitmap down so that i...
分类:
移动开发 时间:
2015-01-29 01:56:55
阅读次数:
370
public?boolean?executeKeyEvent(KeyEvent?event)?{
????????boolean?handled?=?false;
????????if?(event.getAction()?==?KeyEvent.ACTION_DOWN)?{
????????????switc...
分类:
移动开发 时间:
2015-01-29 00:12:25
阅读次数:
382
1.4 Camel’s architecture Let’s now turn our attention to Camel’s architecture. We’ll first take a look at the high-level architecture and then drill down into the specific concepts. After you’...
分类:
其他好文 时间:
2015-01-28 22:41:21
阅读次数:
264
修改完Android工程代码,进入调试阶段时DDMS中报错:The connection to adb is down, and a severe error has occured.由于之前也碰到过这个问题,解决方法在DOS命令下进入ADT的工具目录,执行指令。D:\Tools\adt-bundl...
分类:
系统相关 时间:
2015-01-28 17:41:47
阅读次数:
211
好久没来了,现在来逛逛!给大家带来个小技巧!
首先拖拽一个picker,然后设置picker的hidden为yes,
然后给你的Textfield添加一个touch down 事件,
然后再代码里面如下所示:- (IBAction)select:(id)sender {
pickerView.hidden=NO;
}然后在- (void)viewDidL...
分类:
移动开发 时间:
2015-01-28 16:02:41
阅读次数:
191
Problem Description
A snail is at the bottom of a 6-foot well and wants to climb to the top. The snail can climb 3 feet while the sun is up, but slides down 1 foot at night while sleeping. The snai...
分类:
其他好文 时间:
2015-01-28 14:51:13
阅读次数:
126