|
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
|