previous | index | next

Flow of Control

The function could also be written:

bool increasingOnIntegerRange(int f(int), 
                              int low, 
                              int high) {
    if ( low == high )
        return true;
    if ( f(low) < f(low+1) )
        return increasingOnIntegerRange(f, 
                                        low+1, 
                                        high);
    return false;
}

Q: Why can the else keyword be omitted?

A:


previous | index | next