Ch 11 Queue Implementation
In a circular array-based implementation of a queue, what is the performance when the enqueueoperation does not resize the array?
O(1)
In a doubly linked chain implementation of a queue, what is the performance when the dequeue operation ?
O(1)
In a linked chain implementation of a queue, the performance of the enqueue operation is
O(1)
In a linked chain implementation of a queue, the performance of the getFront operation is
O(1)
In a two-part circular linked chain implementation of a queue, what is the performance when the dequeue operation ?
O(1)
In a circular array-based implementation of a queue, what is the performance when the enqueueoperation if you amortize the cost of resizing the array over all additions to the queue?
O(log n)
In a circular array-based implementation of a queue, what is the performance when the enqueueoperation must resize the array?
O(n)
When adding a node to a two-part circular linked chain implementation of a queue we insert the new node into the chain
after the node that freeNode reference
When a linked chain contain nodes that reference both the next node and the previous node, it is called a(n)
doubly linked list
In a circular array-based implementation of a queue, frontIndexis equal to one less than backIndexwhen the queue is full.
false
In a circular array-based implementation of a queue, frontIndexis equal to one more than backIndexwhen the queue is empty.
false
In a linked chain implementation of a queue, the enqueue operation could potentially be dependent on the other entries and will require a search.
false
In a linked chain implementation of a queue, the enqueue operation requires a traversal to the end of the chain to insert a new entry onto the queue.
false
In an array-based implementation of a queue, inserting and deleting entries is accomplished using modulo arithmetic.
false
In an array-based implementation of a queue, keeping the front entry of the queue at queue[0] is inefficient.
false
When a circular linked chain is used to represent a queue, it is not necessary to maintain a firstNodedata field.
false
A linked chain whose last node is null is sometimes called a(n)
linear linked chain
In a linked chain implementation of a queue, an external reference to the last node in the chain is called a(n)
tail reference
To efficiently remove a node at the end of a linked chain implementation of a queue requires as
tail reference
In the linked chain implementation of a queue, the chain's tail last node contains
the queue's back entry
In the linked chain implementation of a queue, the chain's first node contains
the queue's front entry
Each node in an ordinary linked chain references only the next node.
true
In a circular array-based implementation of a queue, the available locations are not contiguous.
true
In a circular array-based implementation of a queue, you cannot use only frontIndexto determine when a queue is full.
true
In a linked chain implementation of a queue, when both the firstNode and lastNode entries are null, the chain is empty.
true
When a circular linked chain has one node, the node references itself.
true
You need two external references for a circular doubly linked chain, one for the firstNode and one forthe lastNode.
true
When would you choose a two-part circular chain over a circular chain?
when you frequently add an entry after removing one
In a circular linked chain, when a node is removed from the queue
it is deallocated
An array whose index of the first location follows the index its last one is call
Circular
In a circular array-based implementation of a queue, what is the performance when the dequeue operation ?
O(1)
A two-part circular linked chain implementation of a queue
all of the above
In a two-part circular linked chain implementation of a queue
all of the above
In an array-based implementation of a queue, a possible solution to dealing with the full condition is to
all of the above
When adding a node to a two-part circular linked chain implementation of a queue
all of the above
When removing a node from a two-part circular linked chain implementation of a queue
all of the above
In a linked chain implementation of a queue, when the queue is empty
both & b
If we use a chain of linked nodes with only a head reference to implement a queue which statement is true?
both a & b
How can we tell if a two-part circular linked chain queue is empty?
both the queueNode and freeNode reference the same Node
In a ______ the last node references the first node.
circular linked chain
In a circular array-based implementation of a queue implementation where one unused location is used to differentiate between the front and back of the queue, the frontIndexis _____ than the backIndex.
one more
In a circular array-based implementation of a queue, the initial size of the array should be
one more than the queue's initial capacity