Sort in reverse order

From CodeCodex

Revision as of 03:25, 2 March 2011 by 211.2.129.92 (Talk)

Implementations

Erlang

reverse_sort(List) ->
    lists:reverse( lists:sort(List) ).

Java

Arrays.sort (myArray, Collections.reverseOrder());

Ruby

def reverse_sort(ary)
  ary.sort.reverse
end