Arrays and STL algorithms

Since the last bucket of array is not included and hence we write n and not n-1 in sort(arr, arr + n), I wanted to ask is this true for other STL algorithms too like reverse(), rotate() or next_permutation() in case of arrays ?

@priyam04 yes it is true
like for reverse we use reverse(arr,arr+n) and same for next_permuation(arr,arr+n) and others also
if you still have dout feel free to ask and if clear mark it as resolved

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.