摘要: /** * 使用递归的二分查找 *title:recursionBinarySearch *@param arr 有序数组 *@param key 待查找关键字 *@return 找到的位置 */ public static int recursionBinarySearch(int[] arr,int key,int low... 阅读全文
posted @ 2018-12-10 19:40 林深时见鹿! 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 题目:古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少? 程序分析:兔子的规律为数列1,1,2,3,5,8,13,21.... 具体分析如下: f(1) = 1(第1个月有一对兔子)f(2) = 1(第2个月 阅读全文
posted @ 2018-12-10 19:38 林深时见鹿! 阅读(607) 评论(0) 推荐(0) 编辑
摘要: //1.懒汉模式 public class SingletonDemo { private static SingletonDemo instance; private SingletonDemo(){ } public static SingletonDemo getInstance(){ if(instance==null){ ... 阅读全文
posted @ 2018-12-10 19:33 林深时见鹿! 阅读(173) 评论(0) 推荐(0) 编辑
摘要: /** * @CLassName BubbleSort * @Description 冒泡排序 * @Author wangpengfei * @Email wangpengfei4113@163.com * @Date 2018/12/10 19:00 * @Version 1.0 **/ public class BubbleSort { public static ... 阅读全文
posted @ 2018-12-10 19:12 林深时见鹿! 阅读(156) 评论(0) 推荐(0) 编辑
博客已稳定运行: