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


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

Array sort problem.

From Warren Tang <nospam@tangcs.com>
Newsgroups comp.lang.java.help
Subject Array sort problem.
Date 2011-10-18 03:42 +0800
Organization Aioe.org NNTP Server
Message-ID <j7i0eo$kfs$1@speranza.aioe.org> (permalink)

Show all headers | View raw


Hi,everyone

I have an array:

index value
0	33
1	22
2	44
3	11

Now I'd like to sort it, but I also need to preserve the original index,
like this:

newIndex originalIndex sortedValue
0	3	11
1	1	22
2	0	33
3	2	44

How can this be done conveniently in Java?

Regards,
Warren Tang

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


Thread

Array sort problem. Warren Tang <nospam@tangcs.com> - 2011-10-18 03:42 +0800
  Re: Array sort problem. "Alex Mentis" <foo@invalid.invalid> - 2011-10-17 21:14 +0000
    Re: Array sort problem. Lew <lewbloch@gmail.com> - 2011-10-17 15:54 -0700
      Re: Array sort problem. Warren Tang <nospam@tangcs.com> - 2011-10-19 10:59 +0800
  Re: Array sort problem. Roedy Green <see_website@mindprod.com.invalid> - 2011-10-19 15:22 -0700

csiph-web