What is Linked List?
In computer science, a linked list is a linear collection of data elements whose order is not given by their physical placement in memory. Instead, each element points to the next. It is a data structure consisting of a collection of nodes which together represent a sequence.
A linked list is a linear collection of data elements, called nodes, where the linear order is given by means of pointers.
What is Header Linked List?
A header linked list is a linked list which always contains a special node, called the header node, at the beginning of the list. There are two types of widely used header linked lists. They are Grounded Header List and Circular Header List.
There are two types of header linked list. They are:
- Grounded Header List: A grounded header list is a header list where the last node contains the null pointer.
- Circular Header List: A circular header list is a header list where the last node points back to the header node.
Advantages of Linked List
- Linked list is dynamic data structure.
- Link list can grow and shrink during run time.
- Insertion and deletion operation are easier.
- Efficient memory utilization.
- Faster access time.
- Linear data structures such as stack, queue can be easily implemented.
Disadvantages of Linked List
- Wastage of memory.
- No random access.
- Time Consuming.
- Heap space restriction.
- Reverse traversing is difficult.
Insertion to Linked List
Let LIST be a linked list with successive nodes A and B. Suppose a node N is to be inserted into the list between nodes A and B. After inserting node A now points to the new node N, and node N points to node B, to which A previously pointed.
Deletion from Linked List
Let LIST be a linked list with node N between nodes A and B. Suppose the node N is to be deleted from the list between nodes A and B. After deleting node A now points to the node B, to which N previously pointed.
Thanks for following us. Comment for any question.