need program with an array of 100 elements
that are generated randomly from numbers 1-30
I know this part.
Then need second array to sort and find the numbers that come up the most times.
How do you do this part???
I assume a counter is part of it.
But how do you count "like" elements and keep tract of each instance??
eg. say my array is as follows (made it 10 elements to simplify):
array_a[10]={1,30,24,26,1,2,24,1,1,1};
now code to sort it is not a problem,
but what would second array be doing to add the like numbers?
1 comes up 5 times (1 is the mode of the random array set)
24 comes up 2 times
30, 26, and 2 each come up once
must also be prepared for multiply modes of the random array set
(my program will have 100 elements in random array, so it highly likely that a couple numbers may come up the same amount of times - the most times)
Would the second array assign element of first array to a specific element location and then increment each time that happens?
If so would there be 30 elements of array that is part of the sort and counting??



LinkBack URL
About LinkBacks



