What is Singly Linked List? Advantage and Disadvantages
A singly linked list defined as all nodes are linked together in a few sequential manners, hence, it also knows as a linear linked list.
therefore, clearly it has the beginning and the end. the main problem which comes with this list is that we cannot access the predecessor of the node from the current node.


therefore, we can say that a singly linked list is a dynamic data structure because it may shrink or grow. hence, the shrinking and growing depending on the operation made.
let’s start a singly list by first creating it. I hope you know very well, the linked list is created for using structures, pointers and dynamic memory allocation function malloc().
furthermore, it considers the head as an external pointer. this will help us for creating and accessing other nodes in the linked list.
let’s see the following structures definition and head creation.
|
1 2 3 4 5 6 7 8 9 10 |
struct node { int num; struct node*ptr; }; typedef struct node NODE; NODE*start; start=(node *)malloc(size of(NODE)); WHEN THE STATEMENT start=(node*)malloc(size of(NODE)); |
hence, as you have seen above, it is executed a block of memory sufficient for the store the node is allocated.
therefore its assigns head as the starting address of the node. hence, these all activities can be pictorially shown as given figures.

In C program – the Basic operation on a linked List
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
start node { int num; struct node*ptr; }; void create() { typedef struct node NODE; NODE *start, *first, *temp; int count = 0; char choice; first = NULL; do { start = (NODE*) malloc(size of (NODE)); printf("enter the data item \n"); scanf("%d", &head -> num); if (first! = NULL) { temp -> ptr=head; temp = head; } else { first=temp=head; } fflush(stdin); printf("are you want to continue(type y or Y)"); scanf("%", &choice); } while(choice=='y') || (choice == 'Y'); } |
For Example-1
Suppose that if you want to insert 35 after 30 in the given list as figure 1.1

First of all, create a node 35

therefore, after that Search for the node 30

then, 35 will be insert in the list
hence, this process can be done through the following steps:
New next = temp next
temp next=new
therefore, thus finally the desired node gets inserted.
For Example-2
Here, similary while deleting the desired node

let’s suppose here we want to delete 40, the the first we search the node 40, which want to delete, we also search its previous node, 30

therefore, after that prev next = temp next

furthermore, we make temp node free, hence, the final list will look like this

Advantages of Singly Linked List
there are some advantages of singly Linked List
- it is very easier for the accessibility of a node in the forward direction.
- the insertion and deletion of a node are very easy.
- the Requirement will less memory when compared to doubly, circular or doubly circular linked list.
- the Singly linked list is the very easy data structure to implement.
- During the execution, we can allocate or deallocate memory easily.
- Insertion and deletion of elements don’t need the movement of all the elements when compared to an array.
Disadvantages of Singly Linked List
the disadvantages of singly Linked List are following
- therefore, Accessing the preceding node of a current node is not possible as there is no backward traversal.
- the Accessing of a node is very time-consuming.