+ 2

What's the difference between list and linked list

3rd Nov 2016, 5:33 AM
Infinity
Infinity - avatar
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.
3rd Nov 2016, 5:06 PM
Nikunj Arora
Nikunj Arora - avatar
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".
3rd Nov 2016, 10:11 AM
kamal joshi
kamal joshi - avatar
0
is list controlled by pointers?
4th Nov 2016, 3:17 AM
Infinity
Infinity - avatar
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.
4th Nov 2016, 3:27 AM
Nikunj Arora
Nikunj Arora - avatar
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
4th Nov 2016, 4:06 AM
kamal joshi
kamal joshi - avatar