Multiple Choice
Consider a class that uses the following variables to implement an array-based stack:
String [ ] s = new String[100];
Int top = 0;
The boolean method to check for an empty stack can be written as:
A) return top;
B) if (top == 0.
Return true;
Else
Return false;
C) if (s == null.
Return true;
Else
Return false;
D) if
Return true;
Else
Return false;
Correct Answer:

Verified
Correct Answer:
Verified
Q18: A stack based on a linked list
Q19: The operation for removing an item from
Q20: The stack pop operation<br>A) removes all items
Q21: A stack based on a linked list
Q22: A stream of cars going through a
Q24: A queue invariant is a condition<br>A) obeyed
Q25: Consider a class that uses the following
Q26: Consider a class that uses the following
Q27: In a list implementation of a queue,the
Q28: A stack based on a linked list