lintcode 373. Partition Array by Odd and Even

lintcode 373. Partition Array by Odd and Even_第1张图片
image.png

很像快排,两个指针从两边靠拢。

class Solution {
public:
    /*
     * @param nums: an array of integers
     * @return: nothing
     */
    void partitionArray(vector &nums) {
        // write your code here
        int left = 0, right = nums.size() - 1;
        while(left <= right){
            //cout<

你可能感兴趣的:(lintcode 373. Partition Array by Odd and Even)