Deck 17: 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
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/40
Play
Full screen (f)
Deck 17: Linked Lists
1
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
B
2
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
D
3
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
4
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 40 flashcards in this deck.
Unlock Deck
k this deck
5
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
A)appending a node
B)traversing the list
C)inserting or deleting a node
D)All of these
E)None of these
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
6
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
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
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
7
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 40 flashcards in this deck.
Unlock Deck
k this deck
8
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 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
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
9
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 40 flashcards in this deck.
Unlock Deck
k this deck
10
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 40 flashcards in this deck.
Unlock Deck
k this deck
11
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)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
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
12
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)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
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
13
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 40 flashcards in this deck.
Unlock Deck
k this deck
14
In 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)head pointer
B)tail pointer
C)first node
D)closing curly brace of the original structure declaration
E)None of these
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
15
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 40 flashcards in this deck.
Unlock Deck
k this deck
16
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)cruising
B)traversing
C)node-hopping
D)alternating
E)None of these
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
17
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)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
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
18
To build a list initially, 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 40 flashcards in this deck.
Unlock Deck
k this deck
19
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 40 flashcards in this deck.
Unlock Deck
k this deck
20
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 40 flashcards in this deck.
Unlock Deck
k this deck
21
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 40 flashcards in this deck.
Unlock Deck
k this deck
22
Deleting an entire list simply requires the use of the delete operator.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
23
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
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 40 flashcards in this deck.
Unlock Deck
k this deck
24
A new node cannot become the first node in the list.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
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
A)arranged in descending order
B)arranged in ascending order
C)randomly ordered
D)empty
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
26
Nodes in a linked list are stored in contiguous memory.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
27
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 40 flashcards in this deck.
Unlock Deck
k this deck
28
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
A)doubly-linked list
B)circular linked list
C)backward linked list
D)A and B
E)None of these
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
29
Deleting an entire list requires traversing the list, deleting each node one by one.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
30
Linked lists are less complex to code and manage than arrays.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
31
The Standard Template Library (STL)provides a linked list container.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
32
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 40 flashcards in this deck.
Unlock Deck
k this deck
33
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 40 flashcards in this deck.
Unlock Deck
k this deck
34
A new node must always be made the last node in the list.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
35
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
A)singly-linked
B)doubly-linked
C)circular-linked
D)B and C
E)None of these
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
36
A linked list can consist of structs, objects, or other abstract data types.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
37
A linked list can grow and shrink as a program runs.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
38
If there are no nodes in a linked list, you cannot append a node to the list.
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
39
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 40 flashcards in this deck.
Unlock Deck
k this deck
40
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)circular-linked
B)doubly-linked
C)backwards-linked
D)null-linked
E)None of these
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck