logo

Crowdly

Considere o seguinte cliente de teste do stack      public static void mai...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Considere o seguinte cliente

de teste do stack

     public static

void main(String[] args){

          StackOfStrings stack = new StackOfStrings();

          while (!StdIn.isEmpty()){

               String s = StdIn.readString();

               if (s.equals("-")) StdOut.print(stack.pop());

               else stack.push(s);

          }

}

Qual dos seguintes inputs para o cliente de teste do stack produz o respetivo output?

5 4 3 2 1

More questions like this

Want instant access to all verified answers on moodle24.iscte-iul.pt?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!