The following operations are performed on an initially empty queue of ints. What is the contents of the queue afterwards? The queue is displayed with the front to the left.
q.enqueue (1)
q.enqueue (2)
i=q.getfront ()
q.enqueue (3)
q.enqueue (4)
q.enqueue (5)
i=q.dequeue ()
q.enqueue (6)
Notes: getfront operates analogously to the stack method "top()".
enqueue and dequeue operate as one would expect standard queue operations with those names.
- $1\;2\;3\;4\;5\;6$
- $6\;5\;4\;3\;1$
- $2\;3\;4\;5\;6$
- $1\;2\;3\;4\;6$