Sorting using IComparer


 

Almost every where on Internet we can find the implementation of IComparer for Sorting. And to surprise it has been stated to sort an array in reverse order use Array.reverse(). But I think a better solution is to
return (-1) * ReturnValue {ReturnValue is 0 if values are equal and so on} if going for reverse sort.


Comments (0)

Skip to main content