The Most frequent Number in an array

后端 未结 9 1669
粉色の甜心
粉色の甜心 2021-01-17 14:14

I have this Array i wrote a function MostFreq that takes an array of integers and return 2 values : the more frequent number in the array and its frequency check this code i

9条回答
  •  南方客
    南方客 (楼主)
    2021-01-17 14:55

    From a software engineering standpoint, I would expect a function called MostFreq to return the element with the highest frequency - not the frequency itself. I would switch your out and return values.

提交回复
热议问题