递归算法设计的基本思想是:对于一个复杂的问题,把原问题分解为若干个相对简单类同的子问题,继续下去直到子问题简单到可以直接求解,也就是说到了递推的出口,这样原问题就有递推得解。 关键要抓住的是: (1)递归出口 (2)地推逐步向出口逼近 样例: example: 求5的阶乘。。 例如以下: Jav.....
分类:
编程语言 时间:
2014-07-27 09:58:52
阅读次数:
167
URI : uniform resource identifier统一资源标示符用于指定Web资源的字符串,它定义了Web资源中的各个不同的部分。ex:http://example.org/absolute/URI/with/absolute/path/to/resource.txtftp://ex...
分类:
其他好文 时间:
2014-07-26 16:54:21
阅读次数:
356
先来看效果:
实现方式----->自定义控件
核心代码:
package com.example.wavedemo1;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
i...
分类:
移动开发 时间:
2014-07-26 15:08:20
阅读次数:
311
Service可以和Activity绑定,后者会维持对Service实例的引用,此引用允许你像对待其他实例化的那样,对正在运行的Service进行方法调用。
允许Service和Activity绑定,这样能够获得更加详细的接口。要让一个Service支持绑定,需要实现onBind方法,并返回被绑定Service的当前实例。
package com.example.androidtest.ser...
分类:
移动开发 时间:
2014-07-26 15:07:40
阅读次数:
227
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S="ADOBECODEBA...
题目:Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3, 2],The lon....
分类:
编程语言 时间:
2014-07-26 14:50:11
阅读次数:
226
package com.example.test;import java.util.Timer;import java.util.TimerTask;import android.os.Bundle;import android.os.Handler;import android.os.Messag...
分类:
移动开发 时间:
2014-07-26 14:50:00
阅读次数:
266
创建了一个新项目之后,在src内新建一个类public class 类名 extends View 1 package com.example.activity_view; 2 3 import android.content.Context; 4 import android.graphics.....
分类:
其他好文 时间:
2014-07-26 14:37:00
阅读次数:
236
Givens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1="aabcc",s2="dbbca",Whens3="aadbbcbcac", return true.Whens3="...
分类:
其他好文 时间:
2014-07-26 14:24:50
阅读次数:
251
Problem DescriptionPermutation plays a very important role in Combinatorics. For example ,1 2 3 4 5 and 1 3 5 4 2 are both 5-permutations. As everyone...
分类:
其他好文 时间:
2014-07-26 14:15:48
阅读次数:
237