Hello, I am trying to understand a code, what exactly
&(ipA[iLower + 1]
stands for in the below code (partition function of a quicksort?
void Partition(int* ipA, int iSize) {
// Partitions of size 0 or 1 are already sorted
if (iSize <= 1) {
return;
}
// Select a pivot from the array randomly
int iPivot = ipA[rand() % iSize];
// Indices of the entries to be swapped
int iLower = 0;
int iUpper = iSize - 1;
// Partition array into sections above and below the pivot
while (iLower < iUpper) {
while (ipA[iLower] < iPivot) {
++iLower;
}
while (ipA[iUpper] > iPivot) {
--iUpper;
}
// Swap the entries at the lower and upper indices
int iTemp = ipA[iLower];
ipA[iLower] = ipA[iUpper];
ipA[iUpper] = iTemp;
}
// Recursively call partition on each partititon.
Partition(ipA, iLower);
Partition(&(ipA[iLower + 1]), iSize - iUpper - 1);
}