摘要:
1 /** 2 * 找出B出现在A中的起始位置 3 * @param A 4 * @param lenA 5 * @param B 6 * @param lenB 7 * @date 2016-10-7 8 * @author shaobn 9 */ 10 public static int... 阅读全文
摘要:
1 /** 2 * 找出未出现的最小正整数 3 * @param A 4 * @param n 5 * @date 2016-10-7 6 * @author shaobn 7 */ 8 public static int findArrayMex(int[] a,int n){ 9 int c... 阅读全文
摘要:
1 /** 2 * 找出相邻元素的最大差值 3 * @param a 4 * @param n 5 * @date 2016-10-7 6 * @author shaobn 7 */ 8 public static void findMaxDivision(int[] a,int n){ 9 i... 阅读全文
摘要:
请把纸条竖着放在桌⼦上,然后从纸条的下边向上⽅对折,压出折痕后再展 开。此时有1条折痕,突起的⽅向指向纸条的背⾯,这条折痕叫做“下”折痕 ;突起的⽅向指向纸条正⾯的折痕叫做“上”折痕。如果每次都从下边向上⽅ 对折,对折N次。请从上到下计算出所有折痕的⽅向。 阅读全文
摘要:
/** * 顺时针打印矩阵并返回数组 * @param mat * @param n * @param m * @date 2016-10-7 * @author shaobn */ public static int[] printMatrix(int[][] mat,int n,int m){ Ar... 阅读全文
摘要:
1 /** 2 * 将n*n矩阵顺时针旋转90度 3 * @param mat 4 * @param n 矩阵的阶数 5 * @date 2016-10-7 6 * @author shaobn 7 */ 8 public static void rotateMatrix(int[][] mat,int n){ ... 阅读全文
摘要:
1 /** 2 * 求数组的最大差值 3 * @param a 4 * @param n 5 * @return 6 * @date 2016-10-7 7 * @author shaobn 8 */ 9 public static int getDirs(int[] a,int n){ 10 ... 阅读全文