Can we do this question by using recursion ?
If yes , what should be the approach ?
Doubt regarding Reverse Pointers
take two pointer prev and curr
set prev at this.head
and curr at this.head.next
private void RPointerRecursively(Node prev, Node curr) {
if (curr == null) {
return;
}
RPointerRecursively(prev.next, curr.next);
curr.next = prev;
}
set head and tail after recursion
you can see this
please your doubt as resolved and rate me as well.