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