aspose file tools
The moose likes Java in General and the fly likes DataStructure for getting the maximum element in int array Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "DataStructure for getting the maximum element in int array" Watch "DataStructure for getting the maximum element in int array" New topic
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DataStructure for getting the maximum element in int array
 
Similar Threads
maximum array size in applet
Sun Cirtification
BinarySearch() Question
Learning Project 2
Problem Finding Index Value of a String in Array