Now we process the next one with the same steps. nextNode = head.next; will store the node to the right.
xxxxxxxxxxnewHead = 8nextNode = null// <- 8, 4 ^ current nodeOUTPUT
Results will appear here.
Now we process the next one with the same steps. nextNode = head.next; will store the node to the right.
xxxxxxxxxxnewHead = 8nextNode = null// <- 8, 4 ^ current node