Exam 8: Queues

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Similar to stacks, queues support a FILO protocol.

(True/False)
4.9/5
(42)

By using a circular array implementation, you can simultaneously achieve good running times for both add and pop .

(True/False)
4.8/5
(45)

How would you use a Python list method to remove and return an item at the front of the queue?

(Multiple Choice)
4.9/5
(28)

What are the two fundamental operations of a queue?

(Multiple Choice)
4.8/5
(33)

What is the returned value and the state of the queue after the operation is executed? Current queue state: x a z b Q.peek()

(Multiple Choice)
4.8/5
(35)

What is the precondition to using the pop method on a queue?

(Multiple Choice)
4.8/5
(32)

In the following code for the __eq__ method for the Comparable class, what is the missing code? def __eq__(self, other): If self is other: return True If type(self) != type(other): < missing code > Return self.priority == other.priority

(Multiple Choice)
4.8/5
(36)

The array implementation of a queue must access items at the logical beginning and the logical end.

(True/False)
4.9/5
(30)

In the following code for the add method for a linked queue implementation, what is the missing code? def add(self, newItem): NewNode = Node(newItem, None) If self.isEmpty(): Self.front = newNode Else: Self.rear.next = newNode < missing code > Self.size += 1

(Multiple Choice)
4.8/5
(33)

The peek operation on a queue returns the item at the back of the queue without removing it.

(True/False)
4.8/5
(45)

What happens to processes on the ready queue in a round-robin CPU scheduling scheme?

(Multiple Choice)
4.9/5
(37)

Queues are linear collections.

(True/False)
4.9/5
(39)

In the linked priority queue, what is the time and space analysis for the add method?

(Multiple Choice)
4.8/5
(40)

Each process on the ready queue is pushed onto a stack before being given a slice of CPU time.

(True/False)
4.9/5
(32)

Performing a pop operation on an empty queue throws an exception.

(True/False)
4.8/5
(43)

The list data structure in Python cannot be used to emulate a queue because there is no pop method.

(True/False)
4.9/5
(28)

The structure of a queue lends itself to either an array implementation or a linked implementation.

(True/False)
4.9/5
(34)

When using a circular array implementation for a queue, you maintain a count of the items in the queue to determine if it is full or empty.

(True/False)
4.7/5
(41)

The two fundamental operations supported by queues are pop and insert.

(True/False)
4.8/5
(35)

What is the initial value of the front and rear instance variables in the linked queue?

(Multiple Choice)
4.8/5
(37)
Showing 21 - 40 of 50
close modal

Filters

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