Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Sorter
- {
- public static int[] bubblersort(int[] input)
- {
- for(int i = 0; i < input.length; i++)
- for(int j = 0; j < i; j++)
- if(input[i-j] < input[i-j-1])
- {
- int temp = input[i-j];
- input[i-j] = input[i-j-1];
- input[i-j-1] = temp;
- }
- return input;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement