2014年3月20日

摘要: 参考:http://blog.csdn.net/fstar007/article/details/7230659顺序查找算法for折半查找算法 // 二分查找 折半查找 public int SearchErCha(int[] array, int start, int len, int s) { if (len == 0) { return -1; } int center = start + len / 2; if (array[center] == s) { return ce... 阅读全文
posted @ 2014-03-20 22:07 wjw334 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 参考:http://blog.csdn.net/stellaah/article/details/6798244http://bbs.csdn.net/topics/300116354http://blog.csdn.net/ghsau/article/details/7421217http://b... 阅读全文
posted @ 2014-03-20 15:42 wjw334 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 定义:单例模式(Singleton Pattern):单例模式确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例,这个类称为单例类,它提供全局访问的方法。单例模式的要点有三个:一是某个类只能有一个实例;二是它必须自行创建这个实例;三是它必须自行向整个系统提供这个实例。单例模式是一种对象创建型模式。单例模式又名单件模式或单态模式。结构:public class Singleton{ private static Singleton instance=null; //静态私有成员变量 //私有构造函数 private Singleton() { ... 阅读全文
posted @ 2014-03-20 12:19 wjw334 阅读(636) 评论(0) 推荐(0) 编辑

导航