Question

The correct answer is C, I need explanation for why it is C and not the...

media%2Fa7b%2Fa7b709e0-a1ff-4775-8e10-c6

The correct answer is C, I need explanation for why it is C and not the other answers in as simple as possible.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

we have a predefined stack( LIFO - last in first out ) stk

what the above code is doing is

1. Creating 2 queues(FIFO - First in First out) :- qs[0] and qs[1] .

2. Emptying the elements of the stk randomly into any of the two queues.

3. Pushing the elements of qs[0] back into stk.

4. Pushing the elements of qs[1] back into stk.

5. Printing and deleting the elements of stk from top to bottom.

Now consider every option :

) On emptying dhe elaments of otk ron 12 32 chorces unch or opon A AD0 Co mpty 17 19 20 ve08 9s回 _or. ㅡ.ㅡ와. 10 qs ] . hence we can consider as aseperator all elements o he Jedt stk - A B C D E 12 1ndud-ng A 13 Lunch20 29 30 (038-327) [o1 c6A →.FIPO 5 On emot ry .gs[0l-. StR-=CBA to Lo-Pest - CA 01 n emptin emptying tilstkFCADB SL11 top

Add a comment
Know the answer?
Add Answer to:
The correct answer is C, I need explanation for why it is C and not the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT