File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Array" Watch "Array" New topic
Author

Array

alec stewart stewart
Ranch Hand

Joined: Dec 23, 2003
Posts: 71
I have a float array contaning values 41.96,43.94,15.87,21.56,5.90
now how can i rank them without shufling the values.like while traversing the array it should print:
41.96- 2
43.94- 1
15.87- 4
21.56- 3
5.90 - 5
please some one help as i have to submit this assignment soon.
Vicken Karaoghlanian
Ranch Hand

Joined: Jul 21, 2003
Posts: 522
Originally posted by alec stewart stewart:
I have a float array contaning values 41.96,43.94,15.87,21.56,5.90
now how can i rank them without shufling the values.like while traversing the array it should print:
41.96- 2
43.94- 1
15.87- 4
21.56- 3
5.90 - 5
please some one help as i have to submit this assignment soon.

Hi Alec, it is an assignement you should try to do it yourself, right .
To put you on the right track try searching for the following algorithms, and implement them in JAVA:
1) Bubble Sort.
2) Radix Sort.
3) Insertion Sort.
4) Quick Sort.
Good Luck.


- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. <br />- What truth? <br />- That there is no spoon!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Array