Re: Selection Sort in descending order !!
Clinto said:
> Hello,
>
> I am using the below code to sort an array in ascending order, I also
> need to sort in descending order.
By "ascending order" you mean "smallest first". Think about how the code
determines which is smallest. Can you persuade it to change its mind?
Perhaps by using an operator other than < ? Or maybe by switching a couple
of operands around?
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
|