Question: Consider the following code. Select what will be the output: Queue is a first in first out data structure. So, the while loop will print

Consider the following code. Select what will be the output: Queue is a first in first out data structure. So, the while loop will print the elements in order they were added: C B A Queue is a first in last out data structure. So, the while loop will print the elements in reverse order they were added: A 8C The code will run into an index aut af bound error for using remove(, instead pallo The cade will run inta an error as queue interface can not be iterated using while laap
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
