思路 我的思路是通过前移部分需要移动的奇数元素,来使得数组中的奇数在数组中的前部分,偶数在后部分,通过遍历数组,如果当前元素为奇数,那么我们需要将它前移到它的前一个数不再是偶数为止,对数组中所有奇数都这样做,最终偶数的顺序也会自然排好。 实现 public class JZ13调整数组顺序使奇数位于偶数前面 { public int[] reOrderArray(int[] array) { if (array == null) { return null; } int[] tmp = new int[array.length]; System.arraycopy(array, 0, tmp,...