Upon rereading your question, maybe I answered the wrong one. My previous response was how to find the location of the maximum occurrence, but maybe you meant the number of occurrences of the maximum. In that case, as you traverse the array, every time you find an element greater than the max you have found so far, update the max and set the number of occurrences to 1; if you find an element equal to the max you have found so far, increment the number of occurrences.
Dave On Jun 21, 9:34 am, sharad <[email protected]> wrote: > How will you find the number of occurrence of maximum value in an > array > u can traverse only 1 time -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
