I have implemented a sort sort logic and would like to ask if it is correct. Because at the end of the process the result is expected, but was to do a real test and found several algorithms but none like my.
Follow the code.
int vetor[] = {9, 1, 3, 2, 5, 4, 7, 8, 6, 0};
int aux;
for(int i = 0; n = vetor.length; i < n; i++){
for(int j = 0; j < n - 1; j++){
if(vetor[j] > vetor[i]){
aux = vetor[i];
vetor[i] = vetor[j];
vetor[j] = aux;
}
}
}// fim do for
// aqui mando imprimir o vetor ordenado
for(int i = 0, n = vetor.length; i < n; i++){
System.out.println("" + vetor[i]);
}