Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.27 KB | None | 0 0
  1. public static void bubbleSort(int vect[]) {
  2.     int n, i, aux;
  3.         for (n = 1; n <= vect.length; n++) {
  4.             for (i = 0; i < vect.length - 1; i++) {
  5.                 if (vect[i] > vect[i + 1]) {
  6.                     aux = vect[i];
  7.                     vect[i] = vect[i + 1];
  8.                     vect[i + 1] = aux;
  9.                 }
  10.             }
  11.         }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement