Now newHead = head; will store the current node, to be used as the new next later.
xxxxxxxxxxnewHead = 8nextNode = 4// <- 8, 4OUTPUT
Results will appear here.
Now newHead = head; will store the current node, to be used as the new next later.
xxxxxxxxxxnewHead = 8nextNode = 4// <- 8, 4