随笔分类 - Algorithms
【第五天打卡。
摘要:Bag Sample Compute the average and simple standard deviation of the double values on standard input public class Stats { public static void main (Stri
阅读全文
【第四天打卡。
摘要:In&Out public class test { public static void main(String[] args) { Out out = new Out(args[args.length - 1]); for (int i = 0; i < args.length - 1; i +
阅读全文
【第三天打卡。
摘要:BinarySearch import java.util.Array public class BinarySearch { public static int rank (int key, int[] a) { if (lo > hi) return -1; int lo = 0; int hi
阅读全文
第二天打卡。
摘要:random int value drawn from discrete distribution (i with probability a[i]) public static int double(double[] a) { double r = StdRandom.random(); doub
阅读全文
【唉
摘要:primality test public static boolean isPrime(int N) { if(N < 2) return false; for(int i = 2; i * i < N; i++) if(N % i == 0) return false; return true;
阅读全文
浙公网安备 33010602011771号