自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(26)
  • 收藏
  • 关注

翻译 算法导论第九章9.3.6----k分位数

转自:http://dreamkorea.tistory.com/attachment/jk37.pdf‎9.3-6The kth quantiles of an n-element set are the k-1 order statistics that divide thesorted set into k equal-sized sets (to within1). Give

2013-12-31 09:53:19 4933 1

翻译 算法导论第九章9.3.7----最接近中位数的k个数

转自:mosfet.isu.edu/classes/cs385f10/resources/Introduction%20to%20Algorithms(Instructor's%20Manual).pdf(CLRS 9.3-7) Describe an O(n) algorithm that, given a set S of n distinct numbersand a posit

2013-12-30 18:34:09 3032

原创 Android Animation之Tween

代码摘自:Android 3.0 Animations Beginner's GuideTween用于两个状态之间的就动画切换,独立于View。可以创建Tween,然后将其添加到View的元素。Tween包含,,,和。:view元素从一个位置移动到另一个位置      :view元素以一个轴旋转      :view元素变大或者变小      :修改view元素的a

2013-12-23 12:33:46 1827

原创 Snake Number

蛇形数类似这样的数组8   1   2   3   4    5   6   7   828 29 30 31 32 33 34   927 48 49 50 51 52 35 1026 47 60 61 62 53 36 1125 46 59 64 63 54 37 1224 45 58 57 56 55 38 1323 44 43 42 41 40 39 14

2013-12-22 13:16:50 875

原创 Android Animation之transition

Transition是一种简单的动画显示。这种动画可以平滑的从一种图片变换为另一张图片,不是那种突兀的切换。Transition可以简单的在两帧之间切换,常用于选择与被选择之间切换,或者渐进的今日新的场景。XML文件包含切换的帧图片。transition标签作为容器,item为切换用的帧,android:drawable为图片id。TransitionDrawable获取tra

2013-12-22 00:32:18 8630

原创 Android Animation之frame animation

Frame animation由一系列的静态图片构成,并且按照一定的顺序连续显示,类似电影的感觉。使用animation-list创建图片的序列,属性android:oneshot表示是否循环播放。每个图片使用item标签包含在animation-list中,item包括android:drawable和android:duration属性,分别表示图片资源的id和每张图片的显示时间。

2013-12-21 22:39:50 1464

转载 android httpClient 支持HTTPS的2种处理方式

转自http://my.oschina.net/blackylin/blog/144136参考http://developer.android.com/training/articles/security-ssl.html#Concepts问题:项目中Android https或http请求地址重定向为HTTPS的地址,相信很多人都遇到了这个异常(无终端认证):

2013-12-20 14:42:42 19417 2

转载 random selection

转自算法导论中文版第9.2节线性时间期望的选择算法randomized-select的期望运行时间为Θ(n)。该算饭是一个随机算法,只处理划分的一边。伪代码RANDOMIZED-SELECT(A, p, r, i)1    if p = r2        then return A[p]3    q = RANDOMIZED-PARTATION

2013-12-19 17:53:16 2359

原创 线性表顺序存储--C实现

参照数据结构线性表的抽象类型定义,实现了线性表的顺序存储代码如下#include #include #include #define OK 1#define ERROR -1#define TRUE 1#define FALSE 0#define LIST_INIT_SIZE 10#define LIST_INCR_SIZE 1

2013-12-17 19:48:59 783

原创 单链表倒序

需要将单链表倒序,并输出新的链表核心代码Node *next = root->next;root->next = new_root;new_root = root;root = next;#include typedef struct Node { char data; struct Node* next;} Node;void print_lis

2013-12-17 16:13:41 3209

转载 Android系统中的消息处理Looper、Handler、Message

转自http://blog.csdn.net/llping2011/article/details/10220845Android系统中消息处理原理:          Android系统中每个线程可以拥有唯一一个Looper实例,在Looper的构造函数中创建一个唯一的消息队列MessageQueue,即MessageQueue对于线程来说也是唯一的。而Andro

2013-12-13 10:19:11 797

转载 A Gentle Introduction to Algorithm Complexity Analysis

转自http://discrete.gr/complexity/IntroductionA lot of programmers that make some of the coolest and most useful software today, such as many of the stuff we see on the Internet or use daily

2013-12-13 09:10:08 1910

转载 android: binder

转自https://lkml.org/lkml/2009/6/25/32009/6/19 Daniel Walker > Most of these questions related to the fact that I don't think an> interface like this just slips into the kernel as a driver. Since

2013-12-12 17:24:59 1113

转载 Android平台的IPC通訊機制

转自http://www.runpc.com.tw/content/content.aspx?id=105757Android為目前當紅的手機開發平台,在Google的用心下,將其打造為一個易用、穩定且順暢的作業系統,而其免費且開放原始碼的特性,更是讓所有開發商欣喜不已,紛紛採用為新手機的作業系統。比起以往各家作業系統的遙不可及,現在一般的手機玩家只要有一點JAVA程式基礎,便可輕易的在自己的

2013-12-12 10:47:51 1165

转载 Bus Route

Bus RouteMr. Shim received a request to improve bus routes of a complex city and he researched the bus operation policy of this city.In the city, it operates a bus for all roads from a dep

2013-12-11 11:18:08 2425 1

转载 random quicksort

快速排序的随机化版本快速排序的平均情况运行时间与最佳情况的运行时间很接近,而不是非常接近于最坏情况运行时间。快速排序的平均情况是指假定输入数据的所有排列是等可能的。可以在算法中加入随机化的成分,以便对于所有输入,它均能获得较好的平均情况性能。很多人都认为,快速排序的随机化版本是对足够大的输入的理想选择。RANDOMIZED-PARTITION(A, p, r)1

2013-12-11 10:53:35 1509

转载 Picking up Jewels

Picking up JewelsThere is a maze that has one entrance and one exit.Jewels are placed in passages of the maze.You want to pick up the jewels after getting into the maze through the entranc

2013-12-09 18:53:23 2939

转载 radix-sort

基数排序(radix sort)是一种用在老师穿卡机上的算法。一张卡片有80列,每一列可以在12个位置中的任一处穿孔。排序器可以被机械的“程序化”,以便对一叠卡片中的每一列进行检查,再根据穿孔的位置将它们分别入12个盒子里。这样,操作员就可以逐个地将它们收集起来,其中第一个位置穿孔的放在最上面,第二个位置穿孔的其次,等等。对十进制数字来说,每列中只用到10个位置。一个d位数占用d个列。

2013-12-09 17:11:03 5034

转载 Service Center

Electronics Service Center was visited by a total of N customersService Center has a total of M employees.To those employees that customers visit in order to get in line, line stands, if the servi

2013-12-09 14:26:56 1020

转载 Sky Map

You are making “sky map” to represent constellation (group of starts) in the sky.In each element, 1 means star, 0 means empty.And in a constellation, each start should have at least one connect

2013-12-09 14:25:18 1462

转载 Partial Sequence of the Longest Increase

Partial Sequence of the Longest IncreaseA problem to find a partial sequence of the longest increase is well-known in the algorism field.This sequence is defined as the longest sequence among

2013-12-06 08:15:04 1572

转载 counting sort

转自算法导论第二版8.2节计数排序不是比较排序。计数排序是用了输入元素的实际值来确定它们在数组中的位置。计数排序假设n个输入数据中的每一个都是介于0到k之间的整数,此外k为某个整数。当k=O(n)时,计数排序的运算时间为Θ(n)。注意这个算法的前提是每个数据都是0计数排序的基本思想就是对每个输入元素x,确定出小于x的元素个数。有了这个信息,就可以把x直接放到他在最终输出数组

2013-12-05 11:25:39 1743

原创 insert sort

插入排序时一种原地排序算法,稳定的伪代码INSERT-SORT(A)1    for i 2        do key 3        j 4        while j > 0 and A[j] > key5            do A[j+1] 6            j 7        A[j+1] = key#inclu

2013-12-04 17:04:11 875

转载 QuickSort

QuickSort是一种原地排序算法,不稳定。最坏情况是O(n2),平均和最好情况是O(nlogn)/* * #include * * void swp(int *a, int *b) * { * if (a != b) { * *a = *a^*b; * *b = *a^*b; * *a = *a^*b; * } *

2013-12-03 16:25:51 731

翻译 树的性质

离散数学第7章定理2带有n个顶点的树含有n-1条边。定理3带有i个内点的正则m元树含有n=mi+1个顶点。定理4一个正则m元树若带有(i)n个顶点,则带有i=(n-1)/m个内点和l=[(m-1)n+1]/m个树叶;(ii)i个内点,则带有n=mi+1个顶点和l=(m-1)i+1个树叶;(iii)l个树叶,则带有n=(ml-1)/(m-1)个

2013-12-02 22:31:04 1199

原创 选择排序----select sort

选择排序是一种原地排序算法。时间复杂度为O(n2)#include void swp(int *a, int *b){ *a = *a^*b; *b = *a^*b; *a = *a^*b;}int main(void){ int i; int a[10] = { 8, 5, 2, 6, 9, 3, 1, 4, 0, 7 };

2013-12-02 13:25:05 826

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除