In a exercise that I came across, I'm requested to use a linked list. I know the use of arrays and array list, but how does it differ from linked list (array list I mean, I know the array has a specific number of elements).
What I'm requested to do is to store some elements in linked list. What I thought of doing is storing some values in an array and using those reference to store inside the linked list. The user can enter any amount of strings inside the array. The array it self has 24 names so the user can either chose 1 or all 24.
Is it possible to use the linked list without using the nodes to connect it? As in, if I am printing the values off the linked list, can I not just use a for loop?
What is the actual reason to use nodes? I know it is to connect, but if I connect using them, can I use linked list in any order or do I have to go through that specific order? If anyone can explain using few examples, that would be of great help.