Advertisement
Donald_Fortier

bool isSorted( const int[], int );// C++

May 28th, 2015
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. using namespace std;
  2.  
  3. bool isSorted( const int[], int );// Prototype for this function
  4.  
  5. bool isSorted( const int list[], int size ) {
  6.     for ( int i = 1, next = 2; next <= size; i++, next++ )
  7.             if ( list[ i ] > list[ next ] )
  8.                 return false;
  9.     return true;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement