public void sort ( ) { Arrays . sort ( freeOrdinals , 0 , size ) ; /// reverse the ordering int midpoint = size / 2 ; for ( int i = 0 ; i < midpoint ; i ++ ) { int temp = freeOrdinals [ i ] ; freeOrdinals [ i ] = freeOrdinals [ size - i - 1 ] ; freeOrdinals [ size - i - 1 ] = temp ; } }
Ensure that all future ordinals are returned in ascending order .