Finding maximum

/* Finding max number in an integer array
using recursive method.
*/

int max( int a[], int l, int r)
{
    if (l == r) return a[l];
    int m = (l+r)/2;
    int u = max(a, l, m);
    int v = max(a, m+1, r);
    if (u > v) return u;
    else return v;
}

No comments: