摘要:
递归写法: public class Homework3 { public int Fibonacci(int n) { if (n == 0) { return 0; } if (n == 1) { return 1; } return Fibonacci(n-1)+Fibonacci(n-2); 阅读全文
摘要:
public class BSAwesome { public static int getLessIndex(int[] arr){ if (arr==null || arr.length ==0){ return -1; } if (arr[0] < arr[1]){ return 0; } i 阅读全文
摘要:
public class BSNearLeft { public static int nearestIndex(int[] arr, int value) { int L = 0; int R = arr.length - 1; int mid = 0; int index = -1; while 阅读全文
摘要:
public class BSExist { public static boolean exist(int[] arr, int target) { if (arr.length == 0 || arr == null) { return false; } int L = 0; int R = a 阅读全文
摘要:
public class EvenTimesOddNum1 { public static void printOddTimesNum1(int[] arr){ int eor = 0; for (int i = 0;i<arr.length;i++){ eor = eor ^ arr[i]; } 阅读全文