Implement a comprehensive SinglyLinkedList in C++:
struct Node { int data; Node* next; };void insertHead(int val): Inserts at the beginning in $O(1)$.void insertTail(int val): Appends to the end.void insertAt(int index, int val): Inserts at zero-based position index.bool deleteNode(int val): Searches for val and removes the first matching node, releasing memory with delete.void reverse(): Reverses the linked list in-place using a 3-pointer iterative algorithm (prev, curr, next).int findMiddle() const: Uses Floyd's Tortoise and Hare (Slow & Fast pointers) to return the middle node value in a single pass.void display() const: Prints the chain in 10 -> 20 -> 30 -> nullptr format.insertTail(10), insertTail(20), insertTail(30), insertTail(40), insertTail(50).30).50 -> 40 -> 30 -> 20 -> 10 -> nullptr).30 and display updated chain.Original List: 10 -> 20 -> 30 -> 40 -> 50 -> nullptr Middle Element: 30 Reversed List: 50 -> 40 -> 30 -> 20 -> 10 -> nullptr [*] Deleting node 30... Updated List: 50 -> 40 -> 20 -> 10 -> nullptr [✓] Singly Linked List operations verified (Time: 0.007s, Memory: 2.1 MB)