Hi to everyone...! How could i sort an array with float by decrease sorting?
thanks..!
Printable View
Hi to everyone...! How could i sort an array with float by decrease sorting?
thanks..!
if is easy be selection sort, thanks again.
#include <algorithm> and use std::sort instead of implementing a quadratic time sort like selection sort.
keep in mind that std::sort by default sorts in ascending order (smallest to biggest). To make it sort in descending order, you have to supply a comparison function.
thanks but i need with selection sort to do it.
So what you are actually asking is for one of us to write a selection sort for you? That's not how it works here - you write the code, we explain what's wrong, how it works etc when you ask SPECIFIC questions.
--
Mats
IIRC
Code:procedure selection_sort (a, first, last) :
while last > first :
choose highest item in a from [first, last), called max
swap a(max) with a(last)
decrement last
end while
done
Thanks , Perfect Gentleman...!