SHARE
TWEET

Untitled

a guest Jun 25th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. boolean almostIncreasingSequence(int[] sequence) {
  2.    int i, j, k;
  3.    int counter = 0;
  4.    int duplicate=0;
  5.    int tooBig=0;
  6.  
  7.    for (i=0; i <= sequence.length-1; i++){
  8.       for (j=i+1; j <= sequence.length-1; j++){
  9.          if (sequence[i] >= sequence[j]){
  10.             counter++;
  11.             break;
  12.          }
  13.       }
  14.  
  15.    }
  16.  
  17.  
  18.    System.out.println("Counter: " +counter);
  19.  
  20.    if (counter <= 1)
  21.       return true;
  22.    else
  23.       return false;
  24. }
  25.      
  26. for ( outerTrav = 0; outerTrav <= sequence.length-1; outerTrav++ ) {
  27.      for ( innerTrav = outerTrav + 1; innerTrav <= sequence.length-1; innerTrav++ ) {
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top