Method 9: public static int largestElementWithDups(int[] list) A duplicate eleme
ID: 3751820 • Letter: M
Question
Method 9:
public static int largestElementWithDups(int[] list)
A duplicate element is an element which appears more than once in the list. This method returns the largest element in list which has any duplicates whatsoever. If none of the elements have duplicates (every element in the list is unique) then this method should return Integer.MIN_VALUE.
Method 10:
public static void findElementFreqs(int[] list, int[] freqs)
Assume that list and freqs are lists of the same size. For each element in list, this method should count the number of times that elements occurs in the list, and store the value in the same spot in freqs.
For example, if list[3] == 4, and the number 4 appears a total of 7 times in list, then the value 7 should be stored in freqs[3]. The same goes for all elements in freqs
I need guidance in these two methods. I can provide the rest of the project, but I specifically don't understand how to answer this without using hashmaps, which our instructor was against.