Question: 1. Consider the method definition public static int findMode (int [ data, int [ fr) datal is an array of integers with data.length elements, guaranteed

 1. Consider the method definition public static int findMode (int [

1. Consider the method definition public static int findMode (int [ data, int [ fr) datal is an array of integers with data.length elements, guaranteed to be in the range 1-99 (inclusive). frl] is an array of integers with 100 elements, initialized to zero. findMode) does this a) fills the frl] array with the number of occurences of each element of datall, such that frli contains the number of occurrences of the integer i (i is in the range 1-99 inclusive) b) finds the most frequently occurring integer in datal] and returns it. If more than one integer occurs with the same maximum frequency, findMode0 returns the smaller one. For example, if data[] = { 2, 99, 98, 4, 98, 4, 98, 1, 4), findMode() will return 4, and fr[1] = 1, fr[2] = 1, fr[4] = 3, fr(98,-3, fil99] = l

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!