Hi,
I'm trying to write a fuction which takes a two dimensional array of integer scores and finds the mode. Right now, the array is hard coded but I want it to be able to change if the number of scores changes. I'm a little stumped. There is probably something in math.h that does this, but I have to write it from scratch.
My idea so far is to read the 2-d array and store the count of each different possible score in another integer array and pass back the array index. Is there a better way of doing this w/out having to use recursion? And, what happens if two different scores have the same count and it's the highest?
Thanks for your help.
-Tyler
I'm trying to write a fuction which takes a two dimensional array of integer scores and finds the mode. Right now, the array is hard coded but I want it to be able to change if the number of scores changes. I'm a little stumped. There is probably something in math.h that does this, but I have to write it from scratch.
My idea so far is to read the 2-d array and store the count of each different possible score in another integer array and pass back the array index. Is there a better way of doing this w/out having to use recursion? And, what happens if two different scores have the same count and it's the highest?
Thanks for your help.
-Tyler