- 博客(4)
- 资源 (7)
- 收藏
- 关注
原创 最大公约数,最小公倍数求法
/** * 最大公約數 * * @param a * @param b * @return */ public static int gcd(int a, int b) { int x = a > b ? a : b; int y = a > b ? b : a; int m = x % y; while (m != 0) { x = y;
2011-10-25 16:23:26
532
原创 字符串Hash算法
public static int BKDRHash(String str) { int seed = 131; // 31 131 1313 13131 131313 etc.. int hash = 0; for (int i = 0; i < str.length(); i++) { hash = (hash * seed) + str.charAt(i); }
2011-10-21 09:09:43
729
原创 int,long与byte[]互转
java中int是32位,long是64位,用byte[]表示分别需要4字节和8字节 public static byte[] intToBytes(int in) { byte[] result = new byte[4]; for (int i = 3, j =
2011-09-10 11:51:21
586
原创 快速排序算法
import java.util.Arrays;import java.util.Comparator;public class QuickSort { /** * 對實現了Comparable接口的對象組成的數組進行排序 * * @param *
2011-09-06 09:16:53
497
jquery api 1.4 zh_cn
2011-05-30
jna - 3.2.4
2011-05-06
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人