Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement