Pradeep
How can you sort the elements of the array in descending order?
By Pradeep in ASP.NET on Sep 17 2009
  • Tushar Mishra
    Sep, 2009 22

    Hello Pradeep

     The answers suggeted by other users should work fine. There are better means of sorting arrays, depending upon the type of data that they carry. Some of the techiniques are Bubble Sort, Liner Sort, Selection Sort each of these will solve your problem, all you have to do modify the logoc appropriately. 

     For Ex.

      A simple Linear Sort  will swap the location of the elements if  (arr[i]>arr[i+1]), then swap , just  change that to if(arr[i+1>arr[i]) , then swap

    • 0
  • Sapna Malik
    Sep, 2009 20

    By calling Sort() method and then Reverse() method.

    • 0
  • rupali
    Sep, 2009 18

    use sort and reverse methods of array

    array.sort() - this sorts in asc order

    array.reverse()

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS