Hi to everyone...! How could i sort an array with float by decrease sorting?
thanks..!
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.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
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
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
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
Last edited by whiteflags; 04-04-2008 at 02:58 AM.
Thanks , Perfect Gentleman...!