Which of the following best describes the structure of a single node in a singly linked list?
Think about how nodes connect in one direction only.
In a singly linked list, each node holds data and a reference (or pointer) to the next node. It does not have a reference to the previous node.
How many references (or pointers) does each node in a singly linked list contain?
Remember, singly linked lists connect nodes in one direction.
Each node in a singly linked list has exactly one reference, which points to the next node in the sequence.
In a singly linked list, how can you identify the last node?
Think about what indicates the end of the list in a chain of nodes.
The last node in a singly linked list has its next reference set to null (or None), indicating no further nodes.
Which statement correctly contrasts nodes in singly linked lists versus doubly linked lists?
Consider how nodes connect in both directions in doubly linked lists.
Singly linked list nodes have one reference to the next node, while doubly linked list nodes have two references: one to the next node and one to the previous node.
What happens if a node in a singly linked list has its next reference accidentally set to null (None) before the actual end of the list?
Think about how traversal depends on the next reference.
If a node's next reference is set to null before the list's actual end, traversal stops at that node, and all nodes after it become unreachable.