Reading Quiz 7

Ace your homework & exams now with Quizwiz!

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


Related study sets

ICDC 2016 Practice Test (Questions)

View Set

Ch 13- Building the Price Foundation Connect Quiz & LearnSmart

View Set

Module 2. Dividing Fractions & Mixed Numbers

View Set

Final Exam - Supervision and Management

View Set

Chapter 7: Benign Disorders of the Female Reproductive Tract

View Set

Thomas Jefferson's Autobiography

View Set

We Have Always Been Here: LGBTQ Voices in History

View Set

Management Accounting Chapter 10

View Set

Chapter 19: Circulation Chapter Questions

View Set