public static void sortDescending ( long [ ] longArray ) { int index = 0 ; long value = 0 ; for ( int i = 1 ; i < longArray . length ; i ++ ) { index = i ; value = longArray [ index ] ; while ( index > 0 && value > longArray [ index - 1 ] ) { longArray [ index ] = longArray [ index - 1 ] ; index -- ; } longArray [ index ] = value ; } }
Sort the long array in descending order using this algorithm .