daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Sorter
  2. {
  3.     public static int[] bubblersort(int[] input)
  4.     {
  5.         for(int i = 0; i < input.length; i++)
  6.             for(int j = 0; j < i; j++)
  7.                 if(input[i-j] < input[i-j-1])
  8.                 {
  9.                     int temp = input[i-j];
  10.                     input[i-j] = input[i-j-1];
  11.                     input[i-j-1] = temp;
  12.                 }          
  13.         return input;
  14.     }
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
 
Top