Question 1. 1. (TCO 2) A special variable that stores a reference to the first n
ID: 644566 • Letter: Q
Question
Question 1.1. (TCO 2) A special variable that stores a reference to the first node is used to provide access to a linked list. Typically, we call it _____ of the linked list. (Points : 3) the first or the headerthe last
the tail
the reference Question 2.2. (TCO 2) In a linked list, every node contains a(n) _____. (Points : 3) reference to the next node in the list
reference to the last node of the list
reference to the first node of the list
array Question 3.3. (TCO 2) A _____ can always be traversed in the backward direction. (Points : 3) linked list
doubly linked list
linked list with a header dummy node
linked list with a trailer node Question 4.4. (TCO 2) A linked list can always be traversed in the _____ direction(s). (Points : 3) forward
backward
forward and backward
circular Question 5.5. (TCO 2) In a doubly linked list, every node has _____. (Points : 4) a next reference
a dummy node
a previous reference
a next reference and a previous reference Question 6.6. (TCO 2) The following class framework corresponds to the class _____.
public class ClassName
{
private int info;
private ClassName next;
//Class methods
} (Points : 4) node
array-based list
list
doubly linked list Question 7.7. (TCO 2) The following declaration corresponds to the node type of the _____ data structure.
public class Node
{
private int info;
private Node next;
//Class methods
} (Points : 4) circular doubly linked list
doubly linked list
linked list
array-based list Question 8.8. (TCO 2) Which linked list operation does the operation method below define?
public boolean operation()
{
return (first.getNext() == null);
} (Points : 4) It initializes the linked list.
It determines if the list is empty.
It inserts an element in the linked list.
It displays the list elements. Question 9.9. (TCO 2) Which linked list operation does the operation method below define?
public boolean operation(int item)
{
Node current = first.getNext();
while(current != null)
{
if (current.getInfo() == item) return true;
current = current.getNext();
}
return false;
} (Points : 4) It displays the list elements.
It finds if item is contained in the linked list.
It inserts item in the linked list.
It removes item from the linked list. Question 10.10. (TCO 2) Suppose that the method below is one of the methods in a LinkedList class. Which does the method return?
public int operation()
{
Node current = first.getNext();
int value = 0;
while(current != null)
{
value += current.getInfo();
current = current.getNext();
}
return value;
} (Points : 4) The sum of all list elements
The smallest element in the list
The greatest element in the list
The number of elements in the list Question 11.11. (TCO 2) The following declaration corresponds to the node type of a _____ data structure.
public class Node
{
private int data;
private Node next;
private Node previous;
//Class methods
} (Points : 4) linked list
doubly linked list
circular linked list
linked list with a header node Question 1.1. (TCO 2) A special variable that stores a reference to the first node is used to provide access to a linked list. Typically, we call it _____ of the linked list. (Points : 3) the first or the header
the last
the tail
the reference
Explanation / Answer
1.1
A special variable that stores a reference to the first node is used to provide access to a linked list. Typically, we call it the first or the header of the linked list.
--------------------------------------------------------------------------------------------------------
1.2
In a linked list, every node contains a(n) reference to the next node in the list.
--------------------------------------------------------------------------------------------------------
3.3.
A doubly linked list can always be traversed in the backward direction.
--------------------------------------------------------------------------------------------------------
4.4.
A linked list can always be traversed in the forward and backward direction(s).
--------------------------------------------------------------------------------------------------------
5.5.
In a doubly linked list, every node has a next reference and a previous reference.
--------------------------------------------------------------------------------------------------------
6.6.
The following class framework corresponds to the class node.
--------------------------------------------------------------------------------------------------------
7.7.
The following declaration corresponds to the node type of the linked list data structure.
--------------------------------------------------------------------------------------------------------
8.8.
Which linked list operation does the operation method below define?
It determines if the list is empty.
--------------------------------------------------------------------------------------------------------
9.9.
Which linked list operation does the operation method below define?
It finds if item is contained in the linked list.
--------------------------------------------------------------------------------------------------------
10.10.
Suppose that the method below is one of the methods in a LinkedList class. Which does the method return?
The sum of all list elements
--------------------------------------------------------------------------------------------------------
11.11.
The following declaration corresponds to the node type of a doubly linked list
data structure.
Hope this helps you.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.