Solved

A Stack Based on a Linked List Is Based on the Following

Question 21

Multiple Choice

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;
The code for testing whether the stack is empty is


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;

Correct Answer:

verifed

Verified

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

Related Questions