Question: Consider the following code. What does the function xyz do ? void xyz ( int n ) { IntQueue q = new IntQueue ( )

 

Consider the following code. What does the function xyz do?


void xyz(int n)


{


IntQueue q = new IntQueue();


q.enqueue(0);


q.enqueue(1);


for (int i = 0; i < n; i++)


{


 int m = q.dequeue();


 int n = q.dequeue();


 q.enqueueلا;


 q.enqueue(+ n);


 print(m);


}






Prints first n Fibonacci numbers in reverse order



Prints First n Fibonacci Numbers



Prints number 0 to n-1



Prints numbers from n-1 to 0

 

Step by Step Solution

3.43 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The detailed answer for the above question is provided below Her... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!