You are given 2 queues, Q1 and Q2. Q1 is already filled with n elements. Q2 is empty
You have to reverse all the elements in Q1.
You cannot use any other space apart from Q2.
only operations permitted would be Q.enqueue() and Q.dequeue()
Time complexity - O(nlogn)
i found this question on a less popular website. http://www.questiondiscussion.com/questions/64/questiondiscussionchallenge-reverse-a-queue-using-an-extra-queue few answers are also there. i am not able to understand the solutions, can anyone help me with is question ?