a[n-1-i] = a[i]; →a[n-1-i] = temp;