Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #1179

Re: Reverse sorting an array

From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.help
Subject Re: Reverse sorting an array
Date 2011-10-01 19:38 -0700
Organization Canadian Mind Products
Message-ID <1jjf871i3ug6e4fui8aaanln5h21r17m0h@4ax.com> (permalink)
References <8ea2add1-ce9c-423b-bdb8-92c461cf9c6d@5g2000yqo.googlegroups.com> <j64aek$23e$1@dont-email.me> <5ff0ec30-9ffe-4513-ac55-c5d16f141399@u6g2000vbo.googlegroups.com> <j65o5r$huv$1@dont-email.me>

Show all headers | View raw


On Fri, 30 Sep 2011 20:50:33 -0400, Eric Sosman
<esosman@ieee-dot-org.invalid> wrote, quoted or indirectly quoted
someone who said :

>     * Negate every element of the array, use Arrays.sort() to put the
>       array in ascending order, and then negate all the elements again.
>       (Note that this won't work if Integer.MIN_VALUE appears in the
>       array, because Integer.MIN_VALUE == -Integer.MIN_VALUE.)
oops

because Integer.MIN_VALUE != -Integer.MIN_VALUE

I have added those three techniques to
http://mindprod.com/jgloss/sort.html
with credit to you.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
It should not be considered an error when the user starts something
already started or stops something already stopped. This applies
to browsers, services, editors... It is inexcusable to 
punish the user by requiring some elaborate sequence to atone,
e.g. open the task editor, find and kill some processes.

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Reverse sorting an array Fred <albert.xtheunknown0@gmail.com> - 2011-09-30 04:03 -0700
  Re: Reverse sorting an array Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-30 07:50 -0400
    Re: Reverse sorting an array Fred <albert.xtheunknown0@gmail.com> - 2011-09-30 15:24 -0700
      Re: Reverse sorting an array Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-30 20:50 -0400
        Re: Reverse sorting an array Roedy Green <see_website@mindprod.com.invalid> - 2011-10-01 19:38 -0700
          Re: Reverse sorting an array Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-10-01 22:58 -0400
            Re: Reverse sorting an array Lew <lewbloch@gmail.com> - 2011-10-01 20:21 -0700
    Re: Reverse sorting an array Fred <albert.xtheunknown0@gmail.com> - 2011-09-30 15:31 -0700
      Re: Reverse sorting an array Roedy Green <see_website@mindprod.com.invalid> - 2011-09-30 15:45 -0700
        Re: Reverse sorting an array Fred <albert.xtheunknown0@gmail.com> - 2011-09-30 16:27 -0700
          Re: Reverse sorting an array Patricia Shanahan <pats@acm.org> - 2011-09-30 16:58 -0700
    Re: Reverse sorting an array Roedy Green <see_website@mindprod.com.invalid> - 2011-09-30 15:43 -0700
      Re: Reverse sorting an array Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-30 20:57 -0400
  Re: Reverse sorting an array Roedy Green <see_website@mindprod.com.invalid> - 2011-09-30 04:58 -0700
    What qualifies as a constant ? (Was: Reverse sorting an array) Mayeul <mayeul.marguet@free.fr> - 2011-09-30 14:45 +0200
      Re: What qualifies as a constant ? (Was: Reverse sorting an array) Lew <lewbloch@gmail.com> - 2011-09-30 07:39 -0700
        Re: What qualifies as a constant ? (Was: Reverse sorting an array) Mayeul <mayeul.marguet@free.fr> - 2011-09-30 17:15 +0200
          Re: What qualifies as a constant ? (Was: Reverse sorting an array) Lew <lewbloch@gmail.com> - 2011-09-30 08:42 -0700

csiph-web