Topic: Linked List Problem / Level: advanced

Problem: How do you split a doubly linked list into two lists where one list contains nodes with prime-numbered positions and the other contains composite-numbered positions?

Run the code to see the output here...