I would like to create a data structure in java, basically I have researched this and the best structure would be a list to allow for duplicates, I would like to attempt this without the Java API. I don't know how to go about doing this or even starting this and have already done around 6 hours of research.
class WordStoringTest implements WordStore {
private String[] words;
public WordStoringTest(int n){
words = new String[n];
}
public void add(String word) {
int count = words.length+1;
words = new String[count];
}
@Override
public int count(String word) {
int count =0;
for(int i=0; i<words.length; i++){
if(words[i].equals(word)){
count++;
}
}
return count;
}
@Override
public void remove(String word) {
// TODO Auto-generated method stub
}
}
I don't know where to start please give me some guidance :) thanks