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 11:10
Look at the far left lane in the picture. explain what the red car is doing and what it needs to do to travel safely.
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Best laptops for college [$100-$500 range]?
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Stops: using the information learned in this course, explain three things you will not do when driving. a. b. c. explain why you will not do these things when driving. starts: using the information learned in this course, explain three things you will do when driving. a. b. c. explain why you will do these particular things when driving. explain one thing you will stop doing as a passenger. explain one thing you will start doing as a passenger.
Answers: 3
question
Computers and Technology, 23.06.2019 16:30
Which of the following is not an enhancement to the standard wiki to make it more attractive for corporations? encryptionwork spacespermission toolspredictive text
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, 13.06.2021 08:40
question
Social Studies, 13.06.2021 08:40
question
Mathematics, 13.06.2021 08:40
question
Physics, 13.06.2021 08:50
question
Mathematics, 13.06.2021 08:50
question
Mathematics, 13.06.2021 08:50
Questions on the website: 13722363