chapter 18 Flashcards
(31 cards)
ADT stands for:
A) Algorithm Dependent Template
B) Algorithm Driven Template
C) Abstract Data Type
D) Automatic Data Type
E) None of these
C
linked list is a series of connected ________.
A) ADTs
B) vectors
C) algorithms
D) nodes
E) None of these
D
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
B
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
D
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
B
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
C
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
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
B
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
D
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
B
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
D
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
C
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
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
C
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
D
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
D
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
A
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
B
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
B
To build a list initially, you can use a(n) ________ routine.
A) build
B) append
C) constructor
D) initialization
E) None of these
B
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
D
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
B
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
D
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
A