public ListNode reverseList2(ListNode head) {
        if (head == null || head.next == null) return head;
        reverse(head);
        head.next = null;
        return newHead;
    }
Case:  Reverse Linked list in one pass without extra space.
This can be solved recursively and iteratively. Iterative solution is given below.
We get each node in iteration and set previous node of this node as next node.
Time complexity is O(N)
src/problems/easy/ReverseLinkedList.java