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;

Computer Science & Information Technology

You might also like to view...

A computer consists of various devices referred to as ________________ , such as the keyboard, screen, mouse, hard disks, memory, DVD drives and processing units.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

If you ____________________ an image by decreasing the resolution, Photoshop throws out pixels.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

A parameter query prompts you for the criteria before running the query

Indicate whether the statement is true or false

Computer Science & Information Technology

Captions can be synchronized with audio and video content.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology