1100 swap(1,3) 1001 swap(0,2) 0011 no swap swap(0,1) (1001) 0101 noswap swap(1,2) (1100) 1010 swap(0,1) 0110 (i,j) for i to numOfValues array[i] = value for i=numOfValues to numOfNulls array[i] = null i = numOfValues-1 j = (numOfValues+numOfNulls)-1 while (i >=0 && j > i) { if (swap (array[i],array[j]) == true) { i -= 1; } j -= 1; }