| Author |
DataStructure for getting the maximum element in int array
|
sreenath reddy
Ranch Hand
Joined: Sep 21, 2003
Posts: 415
|
|
Hi I have an int array which is of size 1000 and the values inside that can be duplicated (mean same value can be present in many places) ...........now given this array i want to array which gives me the positions of the greatest(maximum) element in this array For eg array is : [ 10,20,1,200, 19, 200, 10 ,19,200] given the above array i need an array which gives me [ 3,5,8] . These are the positions of the maximum element (200) in the given array How can i achieve this with greater efficiency ?? can any one let me know
|
 |
Jessica Sant
Sheriff
Joined: Oct 17, 2001
Posts: 4313
|
|
This sounds a lot like a homework assignment. We're not big fans of doing people's work for them -- but we're more than happy to help you help yourself. So.... how do you think is the best way to solve this problem? How would you code it? Why do you think your idea may not be the most efficient?
|
- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
|
 |
 |
|
|
subject: DataStructure for getting the maximum element in int array
|
|
|