WorksheetsC++ linked list
Total questions: 10
Worksheet time: 9mins
A linked list is called "linked" because each node in the series has a pointer that points to the next node in the list.
True
False
If there are no nodes in a linked list, you cannot append a node to the list
True
False
A linked list can grow and shrink as a program runs.
True
False
The (a) points to the first node in a linked list.
A data structure that points to an object of the same type as itself is known as a(n)
(a) data structure.
After creating a linked list’s head pointer, you should make sure it points to (a)
before using it in any operations.
(a) a node means adding it to the end of a list.
(a) a node means adding it to a list, but not necessarily to the end.
(a) a list means traveling through the list.
Consider the following code:
struct ListNode
{
int value;
struct ListNode *next;
};
ListNode *head; // List head pointer
Assume that a linked list has been created and head points to the first node. Write code
that traverses the list displaying the contents of each node’s value member.
(a)
