Insert a node at a specific position in a linked list
Given a singly linked list, a position and an element, the task is to write a program to insert that element in a linked list at a given position.
Examples:
Input: 1 2 3 4 5, data = 6, position = 5
Output:
1->2->3->4->5->None 1->2->3->4->5->6->None
Reference:- GeeksForGeeks
Comments
Post a Comment
Please give us your valuable feedback