A linked list is a sequence of data elements, which are connected together via links.
Each data element contains a connection to another data element in form of a pointer.
Python does not have linked lists in its standard library.
So we create linked list using classes.
Advantages
Dynamic Data Structure:- it can grow and shrink at runtime by allocating and deallocating memory.
Insertion and Deletion:- Unlike array here we don’t have to shift elements after insertion or deletion of an element.
No Memory Wastage:- As size of linked list can increase or decrease at run time so there is no memory wastage
Implementation:- Data structures such as stack and queues can be easily implemented using linked list.
Disadvantages
Memory Usage:- More memory is required to store elements in linked list as compared to array.
Traversal:- Elements or nodes traversal is difficult in linked list. We can not randomly access any element as we do in array by index
Reverse Traversing:- In linked list reverse traversing is really difficult.