Afficher un message
Vieux 21/10/2007, 08h21   #2
Richard Heathfield
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
 
Page generated in 0,05044 seconds with 9 queries