Given the head of a singly linked list, reverse it in-place using an iterative approach (no recursion) and return the new head.
Use three pointers: prev (initially NULL), curr (head), and next_node.
Input: Head of a singly linked list.
Output: Head of the reversed linked list.
Input: [1,2,3,4,5]
Output: [5,4,3,2,1]
Explanation: Iteratively: prev=NULL,curr=1 → save next=2, 1.next=NULL, prev=1,curr=2 → … → prev=5,curr=NULL. Return prev=5.Input: [1,2]
Output: [2,1]
Explanation: Two nodes: 1.next=NULL, 2.next=1. Return 2.Input: [7]
Output: [7]
Explanation: Single node. Return as-is.1<=nodes<=10^4-10^9<=Node.val<=10^9