John Matthews wrote:Hi Mark

Do you know the range of the numbers? If you do, and it's 'small' eg. 0..9, then you can just use an array of counts which is indexed by number. You go through the array, and for each number N you increment count[N].

But if the range is 'big', or you don't know it, then it becomes a bit more complicated. I would probably use a list of number/count pairs, but there are various ways to implement a 'list'.

I'm assuming this is C - if it's C++ (not my strong point) then there are likely to be better options for the big/unknown range case based around hashing.

So, C or C++, and do you know the number range?

I don't know how much rows have each time.Only i know is that my columns are 7.I have thought to create a new array to store here the frequency but i don't know what to do when i found again the element that previously have found their frequency.