|
-
Indexing an array
Hi, I am hoping that someone can help me with a relatively simple array sorting problem.
I have one array of 4 double elements e.g. {3, 8, 5, 2}
The position of each element in the array has meaning e.g. the value 5 belongs to "machine 3" (as the 3rd element in the array - position 0 = "machine 1")
I need to create a second array that contains the positions of the values in the array above in ascending order e.g. {3, 0, 2, 1}
I can't touch the first array - it must remain as it is.
Could someone perhaps give me some demo code?
Thank you for reading
Similar Threads
-
By kanakatam in forum Java
Replies: 2
Last Post: 04-15-2005, 09:06 PM
-
By Shaitan00 in forum Java
Replies: 3
Last Post: 04-08-2005, 05:49 AM
-
By Jason Salas in forum ASP.NET
Replies: 2
Last Post: 04-20-2003, 11:39 PM
-
By Mark Alexander Bertenshaw in forum VB Classic
Replies: 10
Last Post: 06-16-2000, 05:34 AM
-
By Mark Alexander Bertenshaw in forum VB Classic
Replies: 0
Last Post: 06-12-2000, 08:15 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks