Delete N nodes after M nodes of a linked list

Delete N nodes after M nodes of a linked list In this problem, we have given a linked list and two integers M and N. We need to traverse the linked list in such a way that we retain M nodes of the linked list and delete N nodes of the linked list continually till the...

Find the fractional (n/kth) node in the linked list

Find the fractional (n/kth) node in the linked list In this problem, we have given a singly linked list and a number k. Here we need to find the (n/k)th element where n is the number of elements in the linked list. Note: In the case of decimals, ceil value will be...

Rotate a Singly Linked List

Rotate a Singly Linked List This article will explain how we can rotate the singly linked list. Here we have given a singly linked list, and we need to rotate this list by k nodes anti-clockwise where k is a positive number. Example:...

Pin It on Pinterest