input: 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 output: 10 10 9 9 8 8 7 7 6 6 6 6 7 7 8 8 9 9 10 10 Any ideas why it is just sorting the first half? if I output the memArray before the for loop, it shows me the correct order. What is going wrong when i am copying memArray to array?
for (int i = 19; i >= 0; i--) {
      //System.out.println("memArray[" + i + "]: " + memArray[i]);
      array[k] = memArray[i];
      //System.out.println("array["+k+"]: " + array[k]);
      k++;
    }