Linked lists are generally used because they can perform efficient insertion and deletion. Stack, Queues are implemented using Linked Lists.
Here are some questions that would make you understand the basics of Linked Lists.
Q1. What is Linked List?
A linked list is a linear data structure that consists of groups of elements called nodes. Every node contains two parts: data and next. Data contains the actual elements, while next contains the address of the next node.

Representation of linked list.
Q2.What are the basic terminologies of Linked List?
- Empty List - When there is no node in any Linked List, it is called an empty Linked List.
- Null pointer - When the linked list is empty, there is no node in it, then the Null value is set to the pointer. For Example, P= Null:
- Pointer - A pointer always points to the first node of the linked list. The first node to which the pointer points is called a head or header node. Pointer is considered as a reference to the linked list.
- Address - Next part of every node contains the memory address of the next node. This is very useful to go from one node to another that is for traveling purposes. The last node always contains null values in the next part as there is no next node. Where there is a single node, then it contains a Null value in the next part.
- Information - Information is nothing but the actual element present in the node's data part. Example Roll number of Address.
- Next - Next is the second part of a node. It contains the address of the next node. It helps to go from one node to another node.
Q3. Advantages and Disadvantages of Linked List.
Advantages - Linked lists are dynamic data structures, which can grow or shrink by allocating or de-allocating memory while the program is running.
Insertion and deletion operations can be easily implemented in a linked list.
Dynamic data structures such as stack and queues can be implemented using Linked Lists.
Items can be added or remove from the middle of the linked list.
There is no need to define the initial size for a linked list.
Backtracking is possible in two ways linked list.
Disadvantages - Wastage of memory because in linked list pointer needs extra memory for storage.
There is no random access provided to the user; the user has to access each node sequentially. If the user wants to access the nth node, they have to traverse the linked list up to the nth node.
In the Linked list, the nodes are not stored in the contiguous memory locations.
Q4. Name the types of Linked list
There are 3 types of Linked List.
- Linked list
- Circular list
- Doubly list
Linear Linked List - It is the basic form of a Linked List. It is also called a Singly Linked List. In this linked list, every node is made up of two parts: data and next. The data part contains the actual elements, while the next part contains the address of the next node.
The next part of the last node always contains null values. It is a one-way traversing list, which means we can traverse only in the forward direction. We cannot traverse in the backward direction.
The first node is called a head node which is considered as a reference to a linked list.
Circular Linked List - It is the linked list in which the next part of the last node contains the address of the first node to form a circle.
In the circular linked list, we use the concepts of Queue. The queue is a data structure in which the addition of a node is allowed at one end called as rear while removal of a node is allowed at another end called the front.
Hence it can also be considered as a queue as a linked list.
Doubly Linked List - It is the list in which every node contains three parts: data, previous and next. Data contains the actual element, while the previous and next parts contain the addresses of previous and next nodes.
A doubly linked list provides two pointers: next and previous, which address next and previous nodes. A Doubly linked list can be traversed in both forward as well as backward directions.
The delete operations in the doubly linked list are considered more efficient if a pointer to the node to be deleted is given.
Q5. Difference between Singly and Doubly Linked List.
| Parameter | Singly Linked List | Doubly Linked List |
| Node Structure | The node contains two parts of data and links to the next node. | The node contains three parts of data and links to previous and next nodes. |
| Traversing | Only forward traversing is allowed. | Forward and backward, both traversing are allowed. |
| Memory | It uses less memory per node. | It uses more memory per node. |
| Use | A single-linked list can mostly be used for stacks. | A doubly linked list can be used to implement stacks, heaps, binary trees. |
| Complexity | The complexity of insertion and deletion at a known position is O(n). | The complexity of insertion and deletion at a known position is O(1). |
Q6. Compare array and Linked List.
| Parameter | Array | Linked List |
| Basic | It is a consistent set of a fixed number of data items. | It is an ordered set comprising a variable number of the data items. |
| Size | Specified during declaration. | No need to specify: grow and shrink during execution. |
| Searching | Binary Seach and linear search. | Linear search. |
| Memory required | Less | More |
| Memory Utilization | Ineffective | Efficient |
| Order of the elements | Stored consecutively | Stored randomly |
| Stored allocation | Element position is allocated during compile time. | Element position is assigned during run time. |
| Insertion and deletion of an element | Slow relativity as shifting is required. | Easier, fast, and efficient. |
| Accessing the element | Direct or randomly accessed, specify the array index or subscript. | Sequentially accessed, traverse starting from the first node in the list by the pointer. |
You can find in-depth explanations about the linked list on this website Linked list Wikipedia, Linked list data structures and properties of linked list and problem statements are available Linked_Lists_ProblemStatements on this website.
This brings us to the end of this article on Linked List. I hope you are clear with all the concepts that have been shared with you.
You must be logged in to post a comment.