Final answer:
A program typically keeps track of two special nodes in a linked list: the head node and the tail node. The head node serves as the entry point to the list and allows traversal, while the tail node provides efficient access to the end of the list when appending new nodes.
Step-by-step explanation:
In a linked list, a program typically keeps track of two special nodes: the head node and the tail node.
The head node is the first node in the list. It contains the data of the first element and a reference to the next node in the list. It serves as an entry point to the list and allows traversal through the list.
The tail node is the last node in the list. It contains the data of the last element and a reference to null, indicating the end of the list. The tail node provides efficient access to the end of the list when appending new nodes.