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
A linked list is a series of connected _______.
A) ADT's
B) vectors
C) algorithms
D) nodes
E) None of these
A) ADT's
B) vectors
C) algorithms
D) nodes
E) None of these
D
2
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
D
3
Deleting a node is a ______________ step process.
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
B
4
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
5
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
6
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
7
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 NULL
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 NULL
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
8
If the head pointer points to NULL, 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
9
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
10
A __________ is used to travel through a linked list and search for data.
A) node
B) pointer
C) NULL value
D) traversal operator
E) None of these
A) node
B) pointer
C) NULL value
D) traversal operator
E) None of these
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
11
Appending a node means adding it to the end of a list. ________ 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 40 flashcards in this deck.
Unlock Deck
k this deck
12
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
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
13
The last node in a linked list points to ______.
A) NULL
B) the previous node
C) the first node in the list
D) nothing. It does not contain a pointer.
E) None of these.
A) NULL
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
14
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
15
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
16
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
17
To build a list initially, you can use a(n) ________________ routine.
A) build
B) append
C) constructor
D) init
E) None of these
A) build
B) append
C) constructor
D) init
E) None of these
Unlock Deck
Unlock for access to all 40 flashcards in this deck.
Unlock Deck
k this deck
18
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 40 flashcards in this deck.
Unlock Deck
k this deck
19
To create a linked list, you 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
20
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
21
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
22
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
23
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
24
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
25
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
26
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
27
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
28
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
29
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
30
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
31
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
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
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
34
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
35
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
36
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
37
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
38
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
39
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
40
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