logo CodeStepByStep logo

MaxOccurrences

Language/Type: C# collections Dictionary
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 dictionary as auxiliary storage. If the list is empty, return 0. Do not modify the list passed in as a parameter.

Method: Write a C# 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.