I am trying to create an array of linked lists
The program I am trying to write has a string array of names, however some names are in the same position of the array.
For example if the name morgan
is in array[0]
and john
is also in array[0]
how can I create a linked list that allows both of the names to be stored in the same index. I am trying to replicate separate chaining
collision resolution.
Is it possible to use LinkedList<String> inkedlist = new LinkedList();
If I use that how can I create a new linked list for each array index?
for(int i = 0; i < array.length; i++){
array[i] = new LinkedList();
}