上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: 1、两个自然数的最大公约数: 以小数(除数)除大数(被除数),得余数,如果余数不为0,则小数(除数)作为被除数,余数作为除数,相除后得新余数。若余数为0,则此除数即为最大公约数。否则继续辗转相除。 利用while循环,判断条件是余数是否为0,循环体内将除数做被除数,余数做除数。 另外两个数的:最大公 阅读全文
posted @ 2016-05-11 10:40 回看欧洲 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 代码更新自上篇,如下: 阅读全文
posted @ 2016-04-25 18:50 回看欧洲 阅读(343) 评论(0) 推荐(0) 编辑
摘要: 1 package ren.laughing.datastructure.algorithm; 2 /** 3 * 排序 4 * @author Laughing_Lz 5 * @time 2016年4月22日 6 */ 7 public class Sorter { 8 /** 9 * 直接插入排序(从小到大) 时间复杂度为O(n^... 阅读全文
posted @ 2016-04-22 20:47 回看欧洲 阅读(475) 评论(1) 推荐(0) 编辑
摘要: 1 package ren.laughing.datastructure.baseImpl; 2 3 /** 4 * 自平衡二叉查找树AVL 继承二叉查找树 5 * 6 * @author Laughing_Lz 7 * @time 2016年4月20日 8 */ 9 public class AVLTree extends BSTree { ... 阅读全文
posted @ 2016-04-20 18:57 回看欧洲 阅读(384) 评论(0) 推荐(1) 编辑
摘要: 二分查找要求使用顺序数组,此处用例为递增的int数组 关于二叉搜索树,实现功能有:search, min,max,getSuccessor,getPredecessor,insert,remove 阅读全文
posted @ 2016-04-19 21:03 回看欧洲 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 1 package ren.laughing.datastructure.baseImpl; 2 3 import ren.laughing.datastructure.base.List; 4 5 /** 6 * 创建Huffman树 7 * 生成Huffman编码 8 * @author Laughing_Lz 9 * @time 2016年4... 阅读全文
posted @ 2016-04-14 17:51 回看欧洲 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 1 package ren.laughing.datastructure.baseImpl; 2 3 import ren.laughing.datastructure.base.Iterator; 4 import ren.laughing.datastructure.base.LinkedList; 5 import ren.laughing.datastructure... 阅读全文
posted @ 2016-04-13 21:03 回看欧洲 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 1 package ren.laughing.datastructure.baseImpl; 2 3 import ren.laughing.datastructure.base.Node; 4 /** 5 * 二叉树存储结构结点定义:三叉链表 6 * 三个指针域包含父结点、左孩子、右孩子 7 * @author Laughing_Lz 8 * @tim... 阅读全文
posted @ 2016-04-13 11:44 回看欧洲 阅读(608) 评论(0) 推荐(0) 编辑
摘要: 1 package ren.laughing.datastructure.Instance; 2 /** 3 * 递归案例 4 * @author Laughing_Lz 5 * @time 2016年4月13日 6 */ 7 public class RecuisionInstace { 8 /** 9 * 汉诺塔问题 10 * 结束条件:... 阅读全文
posted @ 2016-04-13 10:14 回看欧洲 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 关于迷宫解法的问题,虽然看懂了,但感觉不是最优解。等复习到优先算法时候再来看吧。 阅读全文
posted @ 2016-04-12 16:32 回看欧洲 阅读(258) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 下一页