Guest User

Untitled

a guest
Oct 17th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. public static int[] sort(int[] list)
  2. {
  3. int length = list.length;
  4.  
  5. for(int j=length-1; j>=0; j--)
  6. {
  7. for(int i=length-1; i>=0; i--)
  8. {
  9. if(list[i]<list[i-1])
  10. {
  11. int temp = list[i-1];
  12. list[i-1] = list[i];
  13. list[i] = temp;
  14. }
  15. }
  16. }
  17.  
  18. return list;
  19. }
Add Comment
Please, Sign In to add comment