chapter 18 Flashcards

(31 cards)

1
Q

ADT stands for:
A) Algorithm Dependent Template
B) Algorithm Driven Template
C) Abstract Data Type
D) Automatic Data Type
E) None of these

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

linked list is a series of connected ________.
A) ADTs
B) vectors
C) algorithms
D) nodes
E) None of these

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The ________ of a linked list points to the first node in the list.
A) starter
B) head
C) tail
D) declaration
E) None of these

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

To append a node to a list means to ________.
A) delete a node from the beginning of the list
B) delete a node from the end of the list
C) add a node to the beginning of the list
D) add a node to the end of the list
E) None of these

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The process of moving through a linked list is referred to as ________ the list.
A) cruising
B) traversing
C) node-hopping
D) alternating
E) None of these

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

If the head pointer points to nullptr, this indicates ________.
A) the list has been previously created and then destroyed
B) the list needs to be destroyed
C) there are no nodes in the list
D) the list is full and cannot accept any new nodes
E) None of these

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

An insertion or deletion routine requires that you create this many pointers for use during the traversal
process.
A) Two—one for the node being inspected, and one for the previous node.
B) Two—one for the node being inspected, and one for the next node.
C) One—for the node being inserted or deleted
D) Three—one for the inspected node, one for the next node, and one for the following node

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How many steps are involved in the process of deleting a node?
A) one—delete the node from memory
B) two—remove the node without breaking links, then delete it from memory
C) three—create a blank node, remove the node being deleted, insert the blank, then delete the node
D) four—create a blank, remove the node being deleted, insert the blank, delete the node, delete the blank
E) None of these

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A doubly-linked list keeps track of the next node in the list, as well as:
A) itself
B) the head node
C) the tail node
D) the previous node
E) None of these

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The list container provided by the Standard Template Library is a template version of a ________.
A) singly-linked list
B) doubly-linked list
C) circular-linked list
D) backward-linked list
E) None of these

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Appending a node means adding it to the end of a list, and ________ a node means putting a new node in the
list, but not necessarily at the end.
A) concatenating
B) popping
C) clamping
D) inserting
E) None of these

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

n a circular-linked list, the last node points to the ________.
A) head pointer
B) tail pointer
C) first node
D) closing curly brace of the original structure declaration
E) None of these

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

f new data needs to be added to a linked list, the program simply ________ and inserts it into the series.
A) allocates another node
B) removes a node
C) borrows a node from the compiler
D) Either B or C
E) None of these

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The advantage a linked list has over a vector is:
A) A linked list can dynamically shrink or grow, and a vector cannot
B) A linked list is smaller than a vector
C) A node can be inserted into or removed from a linked list faster than from a vector
D) Data removal and insertion are more accurate with a linked list than with a vector
E) None of these

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

To create a linked list, you must first create a(n) ________.
A) header file
B) function template
C) exception
D) struct
E) None of these

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which of the following is a basic linked list operation?
A) appending a node
B) traversing the list
C) inserting or deleting a node
D) All of these
E) None of these

17
Q

The last node in a linked list points to ________.
A) a null pointer
B) the previous node
C) the first node in the list
D) nothing. It does not contain a pointer.
E) None of these

18
Q

A ________ is used to travel through a linked list and search for data.
A) node
B) pointer
C) null pointer
D) traversal operator
E) None of these

19
Q

While traversing a list, a node pointer knows when it has reached the end of a list when:
A) it encounters the newline character
B) it encounters a null pointer
C) it finds itself back at the beginning of the list
D) it encounters a sentinel, usually 9999
E) None of these

20
Q

To build a list initially, you can use a(n) ________ routine.
A) build
B) append
C) constructor
D) initialization
E) None of these

21
Q

Variations of the linked list are:
A) doubly-linked list
B) circular linked list
C) backward linked list
D) A and B
E) None of these

22
Q

A linked list class must take care of removing the dynamically allocated nodes. This is done by ________.
A) the constructor function
B) the destructor function
C) overriding the removal function
D) overloading the memory persistence operator
E) None of these

23
Q

A ________ list contains pointers to the nodes before it and after it.
A) singly-linked
B) doubly-linked
C) circular-linked
D) B and C
E) None of these

24
Q

This type of list does not contain a null pointer at the end of the list.
A) circular-linked
B) doubly-linked
C) backwards-linked
D) null-linked
E) None of these

25
To insert a new node in ascending order into a list, the list must be: A) arranged in descending order B) arranged in ascending order C) randomly ordered D) empty
B
26
True/False: 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
27
True/False: When working with a linked list, one of the basic operations you can perform is to destroy the list.
True
28
True/False: If there are no nodes in a linked list, you cannot append a node to the list.
True
29
True/False: A new node must always be made the last node in the list.
FALSE
30
True/False: A new node cannot become the first node in the list.
FALSE
31
True/False: Deleting an entire list requires traversing the list, deleting each node one by one.
TRUE