Alternate Splitting of a given Linked List

Objective: Given a singly linked list, split it into two linked lists. These linked lists will contain the alternate nodes from the given linked list.


Alternate Splitting of a given Linked List


  • Make two pointers(headA and headB) and set it to head and next just to fix the headers for the new linked list.
  • Make Node currNode = head and Node t =
  • Do the traversal of the linked list.
  • Make next = and = (Splitting step).
  • Keep checking whether next!=null &&!=null.

Complete Code:



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: