DEV Community

Fredson Gisa Kaze
Fredson Gisa Kaze

Posted on • Edited on

8 1

Difference between Linked List and Array in CPP

difference-between-arrays-and-linked-list

Basically, an array is a set of similar data objects stored in sequential memory locations under a common heading or a variable name.

While a linked list is a data structure that contains a sequence of the elements where each element is linked to its next element. There are two fields in an element of the linked list. One is the Data field, and the other is the link field, Data field contains the actual value to be stored and processed. Furthermore, the link field holds the address of the next data item in the linked list. The address used to access a particular node is known as a pointer.

Another significant difference between an array and a linked list is that Array has a fixed size and required to be declared prior, but Linked List is not restricted to size and expand and contract during execution. Below is a summarized table showing differences clearly

1_Lnb0IARMGORn_c-gYf-24g

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (4)

Collapse
 
jacquestz profile image
Twizeyimana Jacques

Thanks Fredson.

Collapse
 
taikedz profile image
TaiKedz • Edited
Comment hidden by post author
Collapse
 
gustavy profile image
Manzi Gustave

Thanks

Collapse
 
gisakaze profile image
Fredson Gisa Kaze

great!

Some comments have been hidden by the post's author - find out more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay