Question 110 pts
What are the contents of the queue bankLine after the followingstatements execute? The front of the queue in the answers is theleft-most value
QueueInterface bankLine =newLinkedQueue<>();
bankLine .enqueue(“Johnâ€);
bankLine .enqueue(“Matthewâ€);
String next = bankLine .dequeue();
bankLine .enqueue(“Drewâ€);
bankLine .enqueue(“Heatherâ€);
bankLine .enqueue(“Davidâ€);
next = bankLine .dequeue();
Flag this Question
Question 210 pts
What are the contents of the deque waitingLine after thefollowing statements execute? The front of the queue in the answersis the left-most value
DequeInterface waitingLine = newLinkedDeque<>();
waitingLine.addToFront(“Jackâ€);
waitingLine.addToFront(“Rudyâ€);
waitingLine.addToBack(“Larryâ€);
waitingLine.addToBack(“Samâ€);
String name = waitingLine.removeFront();
Flag this Question
Question 310 pts
How does a queue organize its items?
| according to the order in which they were added |
Flag this Question
Question 410 pts
The ADT priority queue organizes objects
| according to the order in which they were added |
Flag this Question
Question 510 pts
What item is at the front of the list after these statements areexecuted?
DequeInterface waitingLine = newLinkedDeque<>();
waitingLine.addToFront(“Jackâ€);
waitingLine.addToFront(“Rudyâ€);
waitingLine.addToBack(“Larryâ€);
waitingLine.addToBack(“Samâ€);
String name = waitingLine.getFront();
Flag this Question
Question 610 pts
If we use a chain of linked nodes with only a head reference toimplement a queue, which statement is true?
| You must traverse the entire chain to access the lastnode. |
| Accessing the last node is very inefficient. |
Flag this Question
Question 710 pts
In the linked chain implementation of a queue, the chain’s firstnode contains
| the queue’s front entry |
Flag this Question
Question 810 pts
In a linked chain implementation of a queue, the performance ofthe enqueue operation is
Flag this Question
Question 910 pts
In a linked chain implementation of a queue, the performance ofthe getFront operation is
Flag this Question
Question 1010 pts
In a circular array-based implementation of a queue, what is theperformance when the enqueue operation must resize the array?