Reading Quiz 7
To efficiently remove a node at the end of a linked chain implementation of a queue requires a
extra reference in the node pointing to the previous node
In a linked chain implementation of a queue, the performance of the enqueue operation is
O(1)
What type of behavior defines a queue?
first-in first-out
In the linked chain implementation of a queue, the chain's first node contains
the queue's front entry
After the following statements execute, what item is at the front of the queue? QueueInterface zooDelivery = new LinkedQueue(); zooDelivery .enqueue("lion"); zooDelivery .enqueue("tiger"); zooDelivery .enqueue("cheetah"); String next = zooDelivery .dequeue(); next = zooDelivery .dequeue(); zooDelivery .enqueue("jaguar");
"cheetah"
In a circular array-based implementation of a queue, what is the performance when the dequeue operation?
O(1)
What item is at the front of the list after these statements are executed? DequeInterface waitingLine = new LinkedDeque(); waitingLine.addToFront("Jack"); waitingLine.addToFront("Rudy"); waitingLine.addToBack("Larry"); waitingLine.addToBack("Sam"); String name = waitingLine.getBack();
Rudy
What item is at the front of the list after these statements are executed? DequeInterface waitingLine = new LinkedDeque(); waitingLine.addToFront("Jack"); waitingLine.addToFront("Rudy"); waitingLine.addToBack("Larry"); waitingLine.addToBack("Sam"); String name = waitingLine.getFront();
Rudy
What item is at the front of the list after these statements are executed? DequeInterface waitingLine = new LinkedDeque(); waitingLine.addToFront("Jack"); waitingLine.addToBack("Rudy"); waitingLine.addToBack("Larry"); waitingLine.addToFront("Sam"); String name = waitingLine.getFront(); name = waitingLine.getBack();
Sam
Where does a queue add new items?
at the back
Where will you find the item added earliest to a queue?
at the front
In a circular array-based implementation of a queue, the initial size of the array should be
one more than the queue's inital capacity