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