Deck 18: Linked Lists
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/41
Play
Full screen (f)
Deck 18: Linked Lists
1
ADT stands for
A) Algorithm Dependent Template
B) Algorithm Driven Template
C) Abstract Data Type
D) Automatic Data Type
E) None of these
A) Algorithm Dependent Template
B) Algorithm Driven Template
C) Abstract Data Type
D) Automatic Data Type
E) None of these
C
2
A linked list can grow and shrink as a program runs.
True
3
The Standard Template Library (STL) provides a linked list container.
True
4
Nodes in a linked list are stored in contiguous memory.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
5
A list that contains pointers to the previous node, the next node, and a node in the third dimension is known as a triple linked list.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
6
Linked lists are less complex to code and manage than arrays.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
7
Deleting an entire list simply requires the use of the delete operator.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
8
To delete an entire list, normally you must traverse the list, deleting each node, one by one.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
9
A linked list is a series of connected
A) ADTs
B) vectors
C) algorithms
D) nodes
E) None of these
A) ADTs
B) vectors
C) algorithms
D) nodes
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
10
A new node cannot become the first node in the list.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
11
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) 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
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
12
A new node must always be made the last node in the list.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
13
A linked list can consist of structs, objects, and other abstract data types.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
14
When you delete a node from a list, you must ensure that the links in the list are not permanently broken.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
15
When working with a linked list one of the basic operations you can perform is to destroy the list.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
16
If there are no nodes in a linked list, you cannot append a node to the list.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
17
The process of moving through a linked list is referred to as __________ the list.
A) cruising
B) traversing
C) hopping
D) revising
E) None of these
A) cruising
B) traversing
C) hopping
D) revising
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
18
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) starter
B) head
C) tail
D) declaration
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
19
When you create a linked list you must know in advance how many nodes the list will contain.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
20
A linked list is called "linked" because each node in the series has a pointer that points to the next node in the list.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
21
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; the last node does not contain a pointer
E) None of these
A) a null pointer
B) the previous node
C) the first node in the list
D) nothing; the last node does not contain a pointer
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
22
In an insertion or deletion routine:
How many pointers are you required to create for use during the traversal process?
A) two: one for the node under inspection and one for the previous node
B) two: one for the node under inspection and one for the next node
C) one: for the node being inserted or deleted
D) three: one for the node under inspection, one for the next node, and one for the following node
How many pointers are you required to create for use during the traversal process?
A) two: one for the node under inspection and one for the previous node
B) two: one for the node under inspection and one for the next node
C) one: for the node being inserted or deleted
D) three: one for the node under inspection, one for the next node, and one for the following node
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
23
Select all that apply. While traversing a list, a node pointer knows when it has reached the end of the list if
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 such as 9999
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 such as 9999
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
24
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) concatenating
B) popping
C) clamping
D) inserting
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
25
The advantage a linked list has over a vector is that
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 or removed faster from a linked list 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) 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 or removed faster from a linked list than from a vector
D) data removal and insertion are more accurate with a linked list than with a vector
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
26
Which type of list does not contain a null pointer at the end of the list?
A) backwards linked
B) doubly linked
C) circular linked
D) null linked
E) None of these
A) backwards linked
B) doubly linked
C) circular linked
D) null linked
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
27
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) itself
B) the head node
C) the tail node
D) the previous node
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
28
A linked list class must take care of removing the dynamically allocated nodes and 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
A) the constructor function
B) the destructor function
C) overriding the removal function
D) overloading the memory persistence operator
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
29
To insert a new node in ascending order into a list, the list must be
A) arranged in descending order
B) randomly ordered
C) empty
D) arranged in ascending order
E) None of these
A) arranged in descending order
B) randomly ordered
C) empty
D) arranged in ascending order
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
30
Select all that apply. Which of the following is a basic list operation?
A) appending a node
B) traversing the list
C) inserting a node
D) deleting a node
E) None of these
A) appending a node
B) traversing the list
C) inserting a node
D) deleting a node
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
31
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) header file
B) function template
C) exception
D) struct
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
32
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) 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
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
33
Select all that apply. Variations of the linked list are
A) doubly linked list
B) circular linked list
C) frontward linked list
D) backward linked list
A) doubly linked list
B) circular linked list
C) frontward linked list
D) backward linked list
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
34
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 node
D) four: create a blank node, insert the blank node before the node being deleted, remove the node being deleted, delete the blank node
E) None of these
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 node
D) four: create a blank node, insert the blank node before the node being deleted, remove the node being deleted, delete the blank node
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
35
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) singly linked list
B) doubly linked list
C) circular linked list
D) backward linked list
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
36
To build a list initally, you can use a(n) __________ routine.
A) build
B) append
C) constructor
D) initialization
E) None of these
A) build
B) append
C) constructor
D) initialization
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
37
If 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) allocates another node
B) removes a node
C) borrows a node from the compiler
D) Either B or C
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
38
In a circular linked list, the last node points to the
A) head pointer
B) tail pointer
C) first node
D) None of these
A) head pointer
B) tail pointer
C) first node
D) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
39
Select all that apply. A __________ list contains pointers to the nodes before it and after it.
A) multi linked
B) circular linked
C) singly linked
D) doubly linked
A) multi linked
B) circular linked
C) singly linked
D) doubly linked
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
40
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
A) node
B) pointer
C) null pointer
D) traversal operator
E) None of these
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
41
Select all that apply. Which of the following containers can add elements at their back without requiring traversal?
A) the list container
B) the circular_list container
C) the forward_list container
D) the reversal_list container
A) the list container
B) the circular_list container
C) the forward_list container
D) the reversal_list container
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck