Home > Back-end >  DEVC compiler error variable or field ` wiggleSort 'declared void
DEVC compiler error variable or field ` wiggleSort 'declared void

Time:09-27

The class Solution {
Public:

Void wiggleSort (vector & Nums) {
Int left=0, right=nums. The size () - 1;
Int n=right/2;
Int mid=quicksort (left, right, nums, n);
for(int i=1; i<((right + 1)/2); I++) {
If (I % 2!=0) {
Swap (nums [I], nums -i [right]);
}
}

}

{int swap (int n, int m)
int t;
T=n;
N=m;
M=t;

}

Int quicksort (int left, int right, vector & Nums, int n) {
Int I=left, j=right;
Int key=nums [left];

While (iWhile (ij--;
}
If (nums [j] Nums=nums [I] [j];
i++;
}
While (ii++;
}
If (nums [I] Nums=nums [j] [I];
j--;
}
}
Nums [I]=key;
If (I==n) return nums [I];
Else if (iThe else return quicksort (left, -- I, nums, n);
}

};

WiggleSort (vector & Nums) function in this line of quoted variable or field ` wiggleSort 'declared void
  • Related