prev
and curr
, where prev
points to the dummy node and curr
points to the actual head of the list.curr
. For each node:
prev.next
to curr.next
.prev
to point to curr
.curr
to the next node in the list.prev.next
to null to terminate the list.