
void BubbleSort2(int v[], int n) {
    int i, aux, hasChanged;

    do {
        hasChanged = 0;
        for (i=0; i<n-1; i++) {
            if (v[i]>v[i+1]) {
                aux    = v[i];
                v[i]   = v[i+1];
                v[i+1] = aux;
                hasChanged = 1;
            }
        }
    } while(hasChanged==1);

}

