Question: How would I call this function in main? Im mostly trying to figure out what goes in for *returnSize int* sortedSquares(int* A, int ASize, int
How would I call this function in main? Im mostly trying to figure out what goes in for *returnSize
int* sortedSquares(int* A, int ASize, int *returnSize) { int* ans = calloc(ASize, sizeof(int)); *returnSize = ASize; int i = 0, j = ASize - 1, index = ASize - 1; while(i <= j) { if(-A[i] > A[j]) { ans[index--] = A[i] * A[i]; i++; } else { ans[index--] = A[j] * A[j]; j--; } } return ans; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
