Implement a CircularLinkedList in C++ with advanced pointer manipulations:
Node* head where the last node's next points back to head.void insert(int val): Inserts a node while maintaining circular tail-to-head linking.bool deleteNode(int val): Deletes a node (handling head deletion, middle deletion, and single-node list) without breaking the circular cycle.void display() const: Traverses the circular list using do-while loop and prints until returning to head.void splitIntoTwoHalves(CircularLinkedList& firstHalf, CircularLinkedList& secondHalf): Uses fast and slow pointers to split the circular list into two independent circular sub-lists.int solveJosephus(int n, int k): Simulates the historical Josephus Circle Elimination:[10, 20, 30, 40, 50, 60].[10, 20, 30] and [40, 50, 60]).solveJosephus(7, 3) (with 7 people eliminating every 3rd, survivor is person 4).Circular List: 10 -> 20 -> 30 -> 40 -> 50 -> 60 -> (head: 10) [*] Splitting circular list into two equal halves... First Half Circular List: 10 -> 20 -> 30 -> (head: 10) Second Half Circular List: 40 -> 50 -> 60 -> (head: 40) === Josephus Circle Simulation (n=7, k=3) === Eliminated: 3 -> 6 -> 2 -> 7 -> 5 -> 1 Josephus Survivor (n=7, k=3): Person 4 [✓] Circular Linked List & Josephus verified (Time: 0.008s, Memory: 2.1 MB)