Arrays vs Math vs Collections

Arrays (用于固定长度的数组)

Arrays.fill(array, num)
int[][] a = new int[m][n];
for(int[] array: a) {
    Arrays.fill(array, 1);
}

Arrays.sort(array[0], startIndex, end);
Arrays.sort(array[0]);   // O(NlogN)

Math

Math.min, Math.max

Collections

Last updated