> Divide and Conquer algorithm help!?

Divide and Conquer algorithm help!?

Posted at: 2014-12-18 
Below is a C code for finding minimum and maximum number using divide and conquer.

void minmax (int* a, int i, int j, int* min, int* max)

{

int lmin, lmax, rmin, rmax, mid;

if (i == j)

{

*min = a[i];

*max = a[j];

}

else if (j == i + 1)

{

if (a[i] > a[j]) {

*min = a[j];

*max = a[i];

}

else

{

*min = a[i];

*max = a[j];

}

}

else

{

mid = (i + j) / 2;

minmax(a, i, mid, &lmin, &lmax);

minmax(a, mid + 1, j, &rmin, &rmax);

*min = (lmin > rmin) ? rmin : lmin;

*max = (lmax > rmax) ? lmax : rmax;

}

}

My question is lmin,lmax,rmin,rmax are just declared locally.there is no statement to store left min max and right min max value in their respective variables. how a recursive call occurs as

minmax(a, i, mid, &lmin, &lmax);

minmax(a, mid + 1, j, &rmin, &rmax);

could someone explain how this thing work perfectly?