Queue Designer
Submissions: 2377   Accuracy:

76.38%

  Difficulty: Basic   Marks: 1
Associated Course(s):   Fork CPP

Just like Stacks, Queues are also frequently used in solving variety of problems. Let's learn how to design a Queue.

You are given an array A of size N. You need to enqueue the elements of the array into a queue and then print them while dequeue .

Input Format:
The first line of input contains T denoting the number of testcases. T testcases follow. Each testcase contains two lines of input. The first line of input contains size of array N. The second line of array contains the elements of array separated by spaces.

Output Format:
For each testcase, in a new line, print the required output.

Your Task:
Since this is a function problem, you don't need to take any input. Just complete the provided functions

Constraints:
1 <= T <= 100
1 <= Ai <= 107

Examples:
Input:

2
5
1 2 3 4 5
7
1 6 43 1 2 0 5
Output:
1 2 3 4 5
1 6 43 1 2 0 5

** For More Input/Output Examples Use 'Expected Output' option **

Author: Soul_xhacker


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.