2010年6月3日

原创 插入排序算法

摘要: 贴出源码:public class InsertSort {/*** @param source 需要插入的位置,是从索引0开始的* @param p* @param len*/public static void insertSort(int []source,int p,int len){in... 阅读全文

posted @ 2010-06-03 21:41 画一个圆圈 阅读(103) 评论(0) 推荐(0) 编辑

堆结构的实现

摘要: 把源码记录下来:/** * @author Administrator * */public class HeapSort { /* * 查找节点的父节点的位置,索引是从0开始的 */ public static int parent(int i){ return (i-1)>>1; } /... 阅读全文

posted @ 2010-06-03 21:05 画一个圆圈 阅读(113) 评论(0) 推荐(0) 编辑

计算一个无符整数中1Bit的个数 -- 转

摘要: 转自:http://hi.baidu.com/sunyubo458/blog/item/e26e9303439b7a7f3812bb7a.html1.循环法(Iterated Count)int bitcount (unsigned int n) {int count=0; while ... 阅读全文

posted @ 2010-06-03 15:41 画一个圆圈 阅读(278) 评论(0) 推荐(0) 编辑

导航