摘要: 1、穷举算法 时间复杂度(O(n))// 从小到大public static int gcd(int m, int n) { int gcd = 1; for (int i = 2; i = 1; i--) { if (m % i == 0 && ... 阅读全文
posted @ 2015-12-25 20:53 第壹时间 阅读(236) 评论(0) 推荐(0)
摘要: 1、递归方法 时间复杂度(O(2n))public static long fibonacci(long index) { if (index == 0) { return 0; } else if (index == 1) { ... 阅读全文
posted @ 2015-12-25 19:54 第壹时间 阅读(181) 评论(0) 推荐(0)
摘要: 两种方法:一个是使用btye数组(GB2312仅包含常用字,所以会存在失败的情况,推荐使用jar包),一个是引入jar包进行操作。 1、 2、 阅读全文
posted @ 2015-12-25 12:39 第壹时间 阅读(3715) 评论(3) 推荐(1)