List the contents of both queues with the front of the queue leftmost.

Given two initially empty queues, queue1 and queue2 and the following commands.
queue1.enqueue(4)
queue1.enqueue(3)
queue2.enqueue(7)
queue1.enqueue(6)
queue1.dequeue()
queue1.enqueue(queue2.peekFront())
queue2.enqueue(queue1.peekFront())
queue1.dequeue()
queue2.enqueue(7)

Answer: Q1 = 6, 7 Q2 = 7, 3, 7

Computer Science & Information Technology

You might also like to view...

________ software helps run the computer and coordinates instructions between other software and the hardware devices

A) System B) Productivity C) Recovery D) Application

Computer Science & Information Technology

A(n) ________displays as a faded object in a document's background

A) emblem B) insignia C) logo D) watermark

Computer Science & Information Technology