The code for testing whether the stack is empty is

A stack based on a linked list is based on the following code

```
class Node
{
String element;
Node next;
Node(String el, Node n)
{
element = el;
next = n;
}
}
Node top = null;

```

A) return top == null;
B) return top = null;
C)
if (top == null)
return true;
else throw new RunTimeException();
D)
if (top == 0)
return true;
else
return false;

A) return top == null;

Computer Science & Information Technology

You might also like to view...

The WHERE clause, if present, contains

a) a condition that evaluates to TRUE or FALSE b) the number of records to retrieve at a time c) a list of tables from which to select d) the separator to use between retrieved records e) additional fields to retrieve from if the initial list is empty.

Computer Science & Information Technology

The ____ layer of the TCP/IP model maps to both the Data Link and Physical layers of the OSI reference model.

A. Transport B. Internetwork C. Network Interface D. Application

Computer Science & Information Technology