This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Array

 
alec stewart stewart
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 522
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic