logo CodeStepByStep logo

maxOccurrences

Language/Type: Java collections Map
Related Links:

Write a method named maxOccurrences that accepts a list of integers as a parameter and returns the number of times the most frequently occurring integer (the "mode") occurs in the list. Solve this problem using a map as auxiliary storage. If the list is empty, return 0. Do not modify the list passed in as a parameter.

Method: Write a Java method as described, not a complete program or class.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.