Answers for "c++ check if vector is sorted"

C++
0

c++ check if vector is sorted

for(int i = 0; i < n.size()-1; i++)
        if(n[i] > n[i+1])
            return false;
    return true;
Posted by: Guest on March-30-2021

Browse Popular Code Answers by Language