How can you sort the elements of the array in descending order?

 Posted by Poster on 4/27/2008 | Category: C# Interview questions | Views: 8916

By calling Array.Sort() and then Array.Reverse() methods.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Kulygin on: 1/24/2013 | Points: 10
It isn't a good idea to sort an array and then to reverse it. Better solution is to use one of the overloads of Sort method, which allows to set the comparison strategy. (IComparer or Comparison for example).

Login to post response