小算法
文章平均质量分 72
lv_violet
It is better to be hated for what you are than to be loved for what you are not.
展开
-
计算字符串的周期,如abcabc 周期为2
public class Healper { /** * @param str 原字符串 * @return 字符串周期 */ public static int getCycle(String str) { //得到尾字符 char endChar = str.charAt(str.length()-1); //得到尾字符在原字符串中原创 2013-09-23 16:51:10 · 1018 阅读 · 0 评论 -
冒泡排序与交换排序源码 (附图,附注解)
/** * 排序方式类 * @author xiaoya * */ public class SortMethod { /** * 传递一个数组,返回冒牌排序之后的数组(按照传递的排序方式) * @param t 数组数据的单个类型 * @param method 排序的方式: */ public double[] bubbleSort(do原创 2013-09-23 17:29:39 · 685 阅读 · 0 评论