Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

C++ linked list

Total questions: 10

Worksheet time: 9mins

Name
Class
Date
1.

A linked list is called "linked" because each node in the series has a pointer that points to the next node in the list.

a)

True

b)

False

2.

If there are no nodes in a linked list, you cannot append a node to the list

a)

True

b)

False

3.

A linked list can grow and shrink as a program runs.

a)

True

b)

False

4.

The (a)   points to the first node in a linked list.

5.

A data structure that points to an object of the same type as itself is known as a(n)

(a)   data structure.

6.

After creating a linked list’s head pointer, you should make sure it points to (a)  

before using it in any operations.

7.

(a)   a node means adding it to the end of a list.

8.

(a)   a node means adding it to a list, but not necessarily to the end.

9.

(a)   a list means traveling through the list.

10.

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)