But it is clearly mentioned that
insert(Q,i) — inserts the integer i at the rear of the queue.
Hence we have to insert the elements at rear , like 5 will be inserted at rear , then 4 , then 3 , then 2 then 1
Hence correct option should be option A .
But it is also a fact that , in the question , it is no where mentioned that how rear will be decreamented after each function ends .