Find The Most Frequent Value In An Array | C Programming Example

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

What if we wanna find the most frequent number in an array and we don't now the numbers?

burstfireno
Автор

your videos are very helpful thanks a lot!

apseteguia
Автор

I love watching your videos, I was just curious if we take this problem statement to a next level where .. what if a certain number occurs for the same number of time as that the other i.e., if arr[]={1, 2, 2, 3, 3} ;, if we go by the above mentioned algorithm, we will just get max_value as 2 and max_occurrence as 2 which will be unfair to 3 which too occurs for the maximum number of times that is 2 .
What can we do to print all the most occurring number as well as their occurrences in such cases ? 😅, I tried but can't come up with an optimal solution .

adicodes
Автор

if in array two values are hold max occurance, how to manage it

FLUTTER_HUB
Автор

will it work the same if i put the “if (occurences > max_occurences)” inside the inner loop?

Love your videos🙌🏻

rikohalim
Автор

How to write this program?
Write a c program to read a sentence from user and then remove all articles from it and display the updated sentence.
Eg.
Input:An apple a day.
Output:apple day.

yogeshchauhan
Автор

what is the difference between max_value and max__occurenceis??

Vyom