subject
Computers and Technology, 21.03.2020 08:24 mova1o

Write the output produced when the following method is passed each of the following stacks:

public static void mystery1(Stack s) {
Queue q = new LinkedList();
while (!s. isEmpty()) {
int n = s. pop();
q. add(n);
q. add(n);
}
while (!q. isEmpty()) {
s. push(q. remove());
}
System. out. println(s);
}

1. [2, 6, 1]
2. [42, -3, 4, 15, 9]
3. [30, 20, 10, 60, 50, 40]

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:20
This os integrated the processing power of windows nt with the easy-to-use gui of windows 98. windows 2000 windows 3.11 windows for workgroups windowa millennium edition
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
When using a public computer or network, you should always
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
Rafael needs to add a title row to a table that he has inserted in word. what should he do? use the alignment options. use the merge and center option for all the cells in the top row. use the merge and center option on the first two cells in the top row. none of the above
Answers: 3
question
Computers and Technology, 24.06.2019 06:30
For which utilities, if any, does the landlord pay?
Answers: 2
You know the right answer?
Write the output produced when the following method is passed each of the following stacks:
Questions
question
Mathematics, 30.10.2021 02:30
Questions on the website: 13722362