Should head move during traversal?
Usually no. Keep head as the original entry point and use a separate cursor such as temp or current.
LazyCoder
Learn the simplest linked list loop correctly and understand what each move to next actually means.
Traversal is the base pattern behind search, counting, printing, and many update operations. If traversal feels uncertain, every later problem becomes slower and more error-prone.
The loop does not jump through memory magically. Each assignment moves the cursor from one node object to the next link stored inside the current node. The tool makes that movement explicit.
Usually no. Keep head as the original entry point and use a separate cursor such as temp or current.
Null marks the end of the chain. If you do not model the end explicitly, your loop logic becomes ambiguous.