Hi everyone,
Regard the lesson found on Introduction to Linked List > Single Linked List Insertion, I found that we insertAtHead values from 0 to 9. So first node becomes 9, 8, 7, …, and 0.
So with the logic of .printList() in this lesson, 0 is not showing. In other words, the last node of the list will never be printed. It’s like the last node is not counted as part of the list.
My question is if this is a bug or the way we think about linked list? That is when this list has only one element, nothing should be printed?