+ 2
What's the difference between list and linked list
5 odpowiedzi
+ 5
lists are stored sequentially in memory. the elements are stored one after the other. they are faster to access, but slower in addition or deletion of elements.
linked lists are not stored sequentially in memory. each element holds the address of the next element. they are slower to access but faster in addition or deletion of elements.
0
an array of structure without a pointer can be called a "list" whereas a structure with a self referencing pointer (which holds address of next node) present inside to form links is called "linked list".
0
is list controlled by pointers?
0
if you need to access a specific element, you don't need a pointer (like an array). if you need to go through each element, you need an iterator which is kind of like a pointer.
0
just to add: an array name itself is a pointer,so you don't explicitly need to create a pointer to traverse an array