StackOfStrings s = new StackOfStrings(); while (!StdIn.isEmpty()) { String item = StdIn.readString(); if (!item.equals("-")) s.push(item); else if (s.isEmpty()) StdOut.println("BAD INPUT"); else StdOut.print(s.pop() + " "); }

Respuesta :

Explanation

Question 1:

!StdIn.isEmpty() is false.

So, it does not run the loop body.

So, It does not print anything.

Answer:

none of these

Question 2:

If we print the list starting at x, the result would be: 2 3

Answer:

none of these