Exam 5: Queues

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

Is it possible for the front and rear references in a circular array implementation to be equal?

Free
(Essay)
4.9/5
(44)
Correct Answer:
Verified

Yes, it can happen under two circumstances: when the queue is empty, and when the queue is full.

To add an element to a queue you use the____________________ method.

Free
(Multiple Choice)
4.8/5
(45)
Correct Answer:
Verified

B

Which implementation has the worst space complexity?

Free
(Essay)
4.9/5
(34)
Correct Answer:
Verified

Both of the array implementations waste space for unfilled elements in the array. The linked implementation uses more space per element stored.

Because queue operations modify both ends of the collection, fixing one end at index 0 eliminates the requirement that elements be shifted.

(True/False)
4.8/5
(28)

Treating arrays as circular eliminates the need to shift elements in an array queue implementation.

(True/False)
4.7/5
(27)

What are the 3 primary methods for a queue?______

(Short Answer)
4.8/5
(32)

The first operation removes an element at the front of the queue and returns a reference to it.

(True/False)
4.8/5
(32)

A linked implementation of a queue is facilitated by references to the ______ and ______ elements of the linked list.

(Multiple Choice)
4.8/5
(43)

Which of the following operations of a queue examines the element at the front of the queue?

(Multiple Choice)
4.8/5
(26)

When an element is removed from a queue using the dequeue operation, that element is removed from the ____________ of the collection.

(Multiple Choice)
4.8/5
(37)

Queues operate as _______________.

(Multiple Choice)
4.8/5
(47)

The enqueue and dequeue operations work on opposite ends of the collection.

(True/False)
4.8/5
(27)

When an element is added to a queue using the enqueue operation, that element is added to the ____________ of the collection.

(Multiple Choice)
4.8/5
(30)

A ______ implementation of a queue is the preferable array implementation because it does not require elements to be shifted.

(Short Answer)
4.9/5
(43)

The enqueue and dequeue operations work on ______ ends of the collection.

(Short Answer)
4.8/5
(49)

Which implementation has the worst time complexity?

(Essay)
4.8/5
(35)

When one enqueue's an element to a queue, you add that element to the ____ of the queue.

(Short Answer)
4.9/5
(30)

What is the principle difference in behavior between a stack and a queue?

(Multiple Choice)
4.9/5
(35)

The shifting of elements in a noncircular array implementation creates an _______ complexity.

(Multiple Choice)
4.9/5
(38)

When utilizing a circular array for a queue, complete the line of code that updates the value of rear to wrap around the end of the array to the front?

(Essay)
4.8/5
(33)
Showing 1 - 20 of 28
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)