1. Write a program in C to insert a new node at the
beginning of a Singly Linked List.
Test Data :
Input the number of nodes : 3
Input data for node 1 : 5
Input data for node 2 : 6
Input data for node 3 : 7
Expected Output :
Data entered in the list :
Data = 5
Data = 6
Data = 7
2. Write a program in C to create a singly linked list of n nodes and count the number of nodes.
Test Data :
Input the number of nodes : 3
Input data for node 1 : 5
Input data for node 2 : 6
Input data for node 3 : 7
Expected Output :
Data entered in the list are :
Data = 5
Data = 6
Data = 7
Total number of nodes = 3
No comments:
Post a Comment