author avatar

ayushsrivastava

Fri Feb 10 2023

Linked Lists

Linked list are a linear data structure like arrays. But unlike arrays they are not stored in a single place in memory. They are made up of connected nodes, where each node consists of data and address of the next node.

Why do we need Linked List?

• Arrays can store the similar data but they have an upper limit, we need to speculate the size of array in advance, and the allocated memory is generally equal to the speculated size of the array • Inserting and deleting data in between of Array is tedious, but in case of Linked List if we have the head node we can traverse to any node through it and insert new node