We go up the stack back to when 8
was being processed. rest
now simply points to 4
. Now notice what happens:
1// remember, head is 8 - it is being processed
2// head.next is 4
3head.next.next = head;
4// head.next.next was null since 4 wasn't pointing to anything
5// but now head.next (4) points to 8