I am trying to reverse an int array in Java.
This method does not reverse the array.
for(int i = 0; i < validData.length; i++) { int temp =
public void getDSCSort(int[] data){ for (int left = 0, right = data.length - 1; left < right; left++, right--){ // swap the values at the left and right indices int temp = data[left]; data[left] = data[right]; data[right] = temp; } }