Topic: Linked List Problem / Level: advanced

Problem: Write a function to rotate a doubly linked list such that nodes with prime values appear before nodes with composite values.

Run the code to see the output here...