question: public void sort ( int attIndex ) { double [ ] vals = new double [ numInstances ( ) ] ; Instance [ ] backup = new Instance [ vals . length ] ; for ( int i = 0 ; i < vals . length ; i ++ ) { Instance inst = instance ( i ) ; backup [ i ] = inst ; double val = inst . value ( attIndex ) ; if ( Utils . isMissingValue ( val ) ) { vals [ i ] = Double . MAX_VALUE ; } else { vals [ i ] = val ; } } int [ ] sortOrder = Utils . sortWithNoMissingValues ( vals ) ; for ( int i = 0 ; i < vals . length ; i ++ ) { m_Instances . set ( i , backup [ sortOrder [ i ] ] ) ; } }
target:  Sorts the instances based on an attribute. For numeric attributes, instances are sorted in ascending order. For nominal attributes, instances are sorted based on the attribute label ordering specified in the header. Instances with missing values for the attribute are placed at the end of the dataset.