Question: Question 3 [20 points). Implement the function that gets an array of ints of length n, and returns the number of times the maximal element

Question 3 [20 points). Implement the function that gets an array of ints of length n, and returns the number of times the maximal element appears in the array. You may assume that n>0. int count_max (const int* arr, int n); For example: - On input (1,7,-3,7,4,7] the function returns 3 because 7 appears three times. On input (-2,-3,-3] the function returns 1 because -2 appears once. On input [111] the function returns 1 because 111 appears once
Step by Step Solution
There are 3 Steps involved in it
To implement the countmax function you need to Find the maximum value in the array Count how ma... View full answer
Get step-by-step solutions from verified subject matter experts
