Afficher un message
Vieux 21/10/2007, 09h34   #3
Army1987
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Selection Sort in descending order !!

On Sun, 21 Oct 2007 00:10:27 -0700, Clinto wrote:

> Hello,
>
> I am using the below code to sort an array in ascending order, I also
> need to sort in descending order. I cannot get figure out what has to
> change to make this happen. If someone could *point me in the right
> direction, it would be appreciated.

Have you tried to do the most obvious thing to do, namely writing
a greatest() function identical to smallest() except using a > in
the place of a <, and using it instead of smallest()? If so, what
was wrong with the results you got? If not, did you bother to try
and figure out how those functions work?
--
Army1987 (Replace "NOSPAM" with "email")
A hamburger is better than nothing.
Nothing is better than eternal happiness.
Therefore, a hamburger is better than eternal happiness.

  Réponse avec citation
 
Page generated in 0,05537 seconds with 9 queries