C Linked List 6:Insert a new node at the middle of a Singly Linked List [C Programming]

Опубликовано: 15 Октябрь 2024
на канале: JLabs
2,892
57

Insert a new node at the middle of a Singly Linked List.

Expected Output :
Input the number of nodes (3 or more) : 4
Input data for node 1 : 1
Input data for node 2 : 2
Input data for node 3 : 3
Input data for node 4 : 4

Data entered in the list are :
Data = 1
Data = 2
Data = 3
Data = 4

Input data to insert in the middle of the list : 5
Input the position to insert new node : 3

Insertion completed successfully.

The new list are :
Data = 1
Data = 2
Data = 5
Data = 3
Data = 4

=================================================

   • C Programming - Linked List  

Website : http://www.jlabstech.com
Like us on Facebook :   / jlabstechnology  
Follow on Twitter :   / _jlabs_