So I'm writing a program where the program generates 100 random integers between 0 and 9 and stores them in an Array[ with using Linear Search to count the time each value is matched in the Array[]. Values will need to appear multiple times so Linear Search needs to traverse all the elements in the Array[]
What I have got so far is this
public static void main(String[] args) {
int[] randomNumbers = new int[100];
for(int index = 0; index < randomNumbers.length; index++)
{
randomNumbers[index] = (int) (Math.random()*100);
}
for(int index = 0; index < randomNumbers.length; index++)
{
System.out.println(randomNumbers[index]);
}
}
}