You enqueue 4, enqueue 7, dequeue, enqueue 9. What is at the front?
What is the queue rule?
- Last in, first out
- First in, first out
- Largest value leaves first
Same four values through a stack and a queue: how do the outputs compare?
- Identical in both
- Reversed in the stack, arrival order in the queue
- Random in both
The front print job jams. What happens and what fixes it?
- The line reorders itself automatically
- Everything behind waits; cancel or restart the front job and the line flows in order
- Later jobs jump ahead of the jam
Why does a print spooler keep jobs in a queue?
- Printers print fastest in reverse
- One printer serves many in order
- Queues use less paper
Removing from position zero of a Python list is the fastest way to run a huge queue.
Circle one: True False
A student runs editor undo on a queue and oldest edits vanish last. What is the error?
- Undo needs newest first, which is stack order, not queue order
- Queues cannot store edits
- Undo needs no structure at all
Enqueue A, enqueue B, dequeue, enqueue C, dequeue, dequeue. What order leaves?
- A, then B, then C
- C, then B, then A
- B, then A, then C