输入一个整数数组,实现一个函数来调整该数组中数字的顺序,使得所有的奇数位于数组的前半部分,所有的偶数位于数组的后半部分,并保证奇数和奇数,偶数和偶数之间的相对位置不变。
加载中...
import java.util.*; public class Solution { public void reOrderArray(int [] array) { } }
class Solution { public: void reOrderArray(vector
&array) { } };
# -*- coding:utf-8 -*- class Solution: def reOrderArray(self, array): # write code here
class Solution { public int[] reOrderArray(int[] array) { // write code here } }
function reOrderArray(array) { // write code here } module.exports = { reOrderArray : reOrderArray };
# # # @param array int整型一维数组 # @return int整型一维数组 # class Solution: def reOrderArray(self , array ): # write code here
package main /** * * @param array int整型一维数组 * @return int整型一维数组 */ func reOrderArray( array []int ) []int { // write code here }
/** * * @param array int整型一维数组 * @param arrayLen int array数组长度 * @return int整型一维数组 * @return int* returnSize 返回数组行数 */ int* reOrderArray(int* array, int arrayLen, int* returnSize ) { // write code here }