Monday, July 27, 2009

How do you make sorting algorithm in decreasing order using C++ ?

here's my funcion to make it into .. decreasing order.. !!


questions are under this source !!!








Void SelectionSort (int *a , const int n )


{


for (int i=n ; n%26gt;0 ; n --)


{


int j=i;





// find the biggest integer among a[i] to a[n-1]


for (int k= i-1 ; k%26gt;0 ; k--)


if (a[k] %26gt;a[j]) j=k;


swap(a[i],a[j]);


}








!!!! how do I set the size of it ?


is it .


arr[10 20 30 40 ]





like this ?





2. what else do I need ?





3. my final goal is to check the time !!!!


using performance evaluation !!!!





so .. I think I don't need any output !!!


any sugestions about how am I gonna combine .. !!!


all these .. functions in Main function ? !!!

How do you make sorting algorithm in decreasing order using C++ ?
the method u used is bubble sorting


it is much like a trial and error kind try using any others


No comments:

Post a Comment