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