I have two function calling inside C++ STL max function. Which function will be called first ?First one or Second one?
max(rec(a,a[lev+1],lev+1,n,ar),rec(a,(a[lev]+a[lev+2])/2,lev+1,n,ar));
I have two function calling inside C++ STL max function. Which function will be called first ?First one or Second one?
max(rec(a,a[lev+1],lev+1,n,ar),rec(a,(a[lev]+a[lev+2])/2,lev+1,n,ar));
The only requirement is that there is an order. Once the compiler starts evaluating one argument, it has to finish that before it starts evaluating the other argument.
But the optimizer in the compiler may pick on a case-by-case basis what it thinks is best, so you cannot predict up front what choice the compiler will make.