Advertisement
hackmate

Untitled

May 17th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. public static void bubble(int[] a) {
  2. for (int i = 0; i < a.length; i++) {
  3. for (int j = 0; j < a.length - 1; j++) {
  4. if (a[j] > a[j + 1]) {
  5. int temp;
  6. temp = a[j + 1];
  7. a[j + 1] = a[j];
  8. a[j] = temp;
  9. }
  10. }
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement