Hi! So I'm a little lost right now, and am wondering if anyone had any tips for my homework.
So what I need to do is print out the number that appears most in the array. It's supposed to be out of 10,000 numbers, but for now I'm doing 10 because it seems easier to print and test out and I can change the numbers later.
As I currently understand (and wrote out but still a little confused), I should go through the array one value at a time, and go all the way through and increment a count variable every time said number appears. However, I'm a little confused how I should continue... Its not properly counting the max amount of times a number appears (It should only print the # with the highest occurences btw, not all of them - Idk how to do that either.)
Why do we need to sort array?
You only need to find the Max element.
Nowhere in this thread or its title is the goal specified as "find the Max element."
To the OP: You need to keep track of the element value which is the element with the highest element count and its count, as well as the count of the current run. You cannot keep track of two counts with one variable. You also need to avoid indexing bigArray with invalid indexes.
Sorry it was vague I was in a rush, it means the maximum times a number appears - so if 40 appears the most, I'd print that 40 appeared the most and how many times it took to appear.
And which index are you referring to Cire? A little confused here! X: