What is the right code for the boolean empty() method?
A queue based on a linked list uses the following code
```
class Node
{
String element;
Node next;
Node (String el, Node n)
{
element = el;
next = n;
}
}
Node front = null, rear = null;
```
A) return front == null;
B)
if (rear == front)
return true;
else
return false;
C)
if (front == null)
throw new RuntimeException("Empty");
else
return false;
return true;
D) return front == rear;
A) return front == null;
You might also like to view...
Answer the following statements true (T) or false (F)
1. The first two columns of an OS/JCL statement must contain backslash characters. 2. The job name, step name, or DD name is chosen by the programmer using a combination of from 1 to 8 letters and/or digits. 3. On an OS/JCL statement, one or more blanks (or spaces) separate the name field from the operation field, which must be JOB, EXEC, or DD. 4. Stray blanks are the beginner’s most common OS/JCL error. 5. On an OS/JCL JOB statement, the job name is optional.
To differentiate public functions from private functions, private functions int the ADT begin with a(n) _____ character.
A. uppercase B. pound C. back slash D. underscore