I am writing a merge-sort algorithm program for school. The pseudo-code says that I have to create an array 'L' and array 'R' with a size that is determined by calculations done with some array indices.
I could basically hard-code in some large arrays.
However, is there a way of doing the calculations and then inputing the result into the array declaration...
//example of function
MERGE(A,p,q,r)/*where A is array, p is first indice, q is lower bound mid-point, and r id last indice*/
{
n1 = q - p + 1;
n2 = r - q;
int L[n1];
int R[n2];
}