Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Warren Tang Newsgroups: comp.lang.java.help Subject: Array sort problem. Date: Tue, 18 Oct 2011 03:42:18 +0800 Organization: Aioe.org NNTP Server Lines: 23 Message-ID: NNTP-Posting-Host: d+WkA+lehfB0BQZIKBxcuA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.help:1258 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