Question: A. Write a public static method max0ccurrences that accepts a list of CalendarDatesas a parameter and returns the number of times the most frequent occurring

 A. Write a public static method max0ccurrences that accepts a list

A. Write a public static method max0ccurrences that accepts a list of CalendarDatesas a parameter and returns the number of times the most frequent occurring date (the "mode") occurs in the list. Solve this problem using a Map as auxiliary storage. If the list is empty, return O (Hint: part A is basically what you did for the homework exercises, so done in just minutes?) (Hint2: part B is NOT in exercises, and l'm checking to see you practiced using iterators?) B. Write a public static method maxUsingIterator that accepts a list of CalendarDates and returns the maximum date as defined by compareTo. The empty list returns default zero date of Unix epoch zero 1/1/1970. You MUST use an iterator and.next to loop over the list (e.g. p.721 in text) Examples shown below Some starter code import java.util.* // starter code: public class Quiz11 public static void main(Stringl] args) ArrayList list1 = new ArrayList(); list1.add(new CalendarDate(5, 5, 2018)); list1.add(new CalendarDate(1, 2, 2018)); list1.add(new CalendarDate(5, 5, 2018)); list1.add(new CalendarDate(10, 7, 2011)) list1.add(new CalendarDate(5, 5, 2018)); System.out.println(maxOccurrences(list1); // 3 System.out.println(maxUsinglterator(list1); // 5/5/2018 // solutions go below here public static int maxOccurrences(List quiz) {// etc

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!