Guest User

Untitled

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