- Linked List is the data structure ,which is used for storing the linear collection of data elements.
- It is an sequential type data structure.
- Each successive elements are connected by pointer,means every successive elements having the address of the next elements.
- Linked list is collection of node,and every node consist the data and address.
Every node having the data element and address of the next node through pointer.
Data will contain the information stored by the node.and Address will contain the address of the next node.
Address representation
- First node of Linked list is called Head node and their address contain by the Head Pointer.
- Last node can be null addressable or also can contain the address of another node, its depend the type of linked list implementation.
Example :
Here Node-1 contain data element ‘A’ and address portion is pointing to the address of the Node-2 which is 2000.
Comparison of Array and Linked List
Parameter | Array | Linked List |
---|---|---|
Data element | Homogeneous collection of data | Homogeneous as well as Heterogeneous Collection of data |
Indexing Iteration | Supported | Not Supported |
Pointer Iteration | Supported | Supported |
Access Speed | Fast | Not fast |
Size | Fixed Size | Variable and Flexible |
Access type | Random type | Linear Access |
Memory Consumption | Less memory required | More memory required |
Linked List Operations
Following are the general and auxiliary operations of Linked List :
- Insertion : insert an element into linked list
- Deletion of Specific elements.
- Traverse : visit on the all the nodes of linked list.
- Deletion of Complete List.
- Count : counting the number of Nodes of Linked list.
- Search : searching the availability of an data element stored in nodes..
Types of Linked List
There are following category of linked List :
- Singly Linked List
- Doubly Linked List
- Circular Linked List
- Circular Doubly Linked List
Advantage of Linked List
- Linked List can be expanded in the constant time.
- Simple Insertion/deletion operation
- Efficient memory utilization.
- Memory Allocation as per requirement.
- Faster access.
Disadvantage of Linked List
- Random access is not possible in Linked list because of the index unavailability.
- Reverse traversing needs more memory.
- Memory wastage for referencing.