Problem statement
3.5 marks
Implement the following function:
int Most FrequentCharacter(char str[], int n);
The function accepts a string 'str' of length 'n', that contains alphabets. Implement the function to find and return the frequency of the letter
which has the highest frequency.
Assumption: String only contains lower cage letters.
Note: Return -1 if str is empty.
Example:
Input:
str: abcdaabcaba
Output:
5
Explanation:
Frequency of letters:
Frequency of 'a' = 5
Frequency of 'b' = 3
Frequency of 'c' = 2
Frequency of 'd' = 1
Since 'a' has the highest frequency 5, thus output is 5.
WWW
..
WM
WWW
W.
Sample Input
str: yztzxzyx
Sample Output
3
Answers
Answered by
1
Answer:
it is hard and tough and long so I can not do it.sorry
Similar questions