Solved

Given the LinkedListQueue Class Implementation Discussed in Section 16

Question 76

Multiple Choice

Given the LinkedListQueue class implementation discussed in section 16.3 (partially shown below) , select the appropriate statements to complete the add method. public class LinkedListQueue
{
Private Node first;
Private Node last;
Public LinkedListQueue()
{
First = null;
Last = null;
}
Public void add(Object newElement)
{
Node newNode = new Node() ;
NewNode.data = newElement;
NewNode.next = null;
If (last == null)
{
First = newNode;
Last = newNode;
}
Else
{
_____________________
_____________________
}
}
) ..
}


A) last.next = newNode.next;
Last = newNode;
B) last.next = newNode;
Last = newNode;
C) last = newNode;
Last.next = newNode;
D) last = newNode;
Last.next = newNode.next;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents