|
-
Nov 8th, 2008, 12:00 PM
#3
Re: How to find max value?
Appending to LaVolpe's post, if you need to know how many times the maximum value occurs, you will need to have a frequency counter that increments whenever that value is detected. The counter restarts when a new maximum value is detected as it loops through the list.
If you need to know the list positions where the maximum value occurs, that has to be tracked in an array. In your examples, what I believe you meant to say was that the maximum value occurs at positions 3 and 9 for the first list and at position 1 for the second.
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
|
Click Here to Expand Forum to Full Width
|