Linked List is linear data structure where elements are store in contiguous location mean like array linked list elements are stored in one location. The element of linked list is known as node.
A node can have following two information.
Data part of node is used to keep the information like name,age,dob etc. Where as Address part stores memory addresss of next node so that they are connect to each other.
- Dynamic :- The size of linked list is dynamic which means can be increased at run time.
- Insertion/Deletion :- Insertion and Deletion in linked is much faster than array because in array there are lots shifting operation need to perform for this.
- Merging:- Merging two linked list is much faster than merging two arrays as we need to create new array with size(total of both array size) and need to store and each and every element in that array. But in linked list only need to manage address only.
- Random Access : Linked list doesn’t allow random access means you need to go one by one element. But in array we can get element using random access as in array all elements are in a single location. Only address need to be calculated using index and base address.
- Extra Memory Space : Linked list need extra memory space for their pointers but there are no need of extra space in array.
Types of Linked List
- Singly Linked List
- Doubly Linked List
- Circular Linked List