Current Code:
void findMode(int *array, int size)
{
int array2[size];
int count;
int x;
int mode = 0;
for (count = 0; count < size; count++)
{
x = array[count];
array2[x] = array2[x]++;
}
for ( count = 0; count < size; count++)
{
if (array2[count] > mode)
mode = array2[count];
}
}
this is my curren jab at it. im trying to find what the mode is from the array. so far i created a 2nd array to hold the amount of times i see a number. the 2nd loop then finds the largest number (the amount of times ive seen a number).
at this point i have already set numbers to all the array and sorted them from smallest to largest. now im kinda lost on finding the mode.