when I perform the bubble sort in my program, the first number I input changes to "1". I don't know why. ???
Please help. Thanks!
Here's my code for the bubble sort.
bubblesort(int index, int* a){
int x;
int y;
int n = index + 1;
int temp;
view(index, a);
for( x = 0; x < n; x++){
for(y = 0; y < n - 1; y++){
if(a[y] > a[y+1]){
temp = a[y+1];
a[y+1] = a[y];
a[y] = temp;
}
}
}
view(index, a);
}