GATEverse Practice, past papers & mock tests
GATE 2016 · CS1 - Forenoon
Programming & Data StructuresProgrammingeasyMCQ2 marks
The function computes max value in integer array p[] of size n (n >= 1):
c
int max(int *p, int n) {
    int a = 0, b = n - 1;
    while ( _______ ) {
        if (p[a] <= p[b]) { a = a + 1; }
        else { b = b - 1; }
    }
    return p[a];
}
The missing loop condition is:
Save your progress

Related Programming & Data Structures PYQs