Exam 18: Stacks and Queues

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

The operation ____________________ reinitializes a stack to an empty state.

(Short Answer)
4.8/5
(38)

To describe a queuing system, we use the term ____ for the object receiving the service.

(Multiple Choice)
4.7/5
(33)

When describing a queuing system, we use the term ____________________ to refer to the time it takes to serve a customer.

(Short Answer)
4.8/5
(30)

____________________ techniques are used when it is too expensive or dangerous to experiment with real systems.

(Short Answer)
4.8/5
(36)

A stack can be implemented as either a(n) ____ or a linked structure.

(Multiple Choice)
4.9/5
(42)

What is the output of the following code? queueType<int> queue; int x, y; x = 2; y = 3; queue.addQueue(x); queue.addQueue(y); x = queue.front(); queue.deleteQueue(); queue.addQueue(x + 2); queue.addQueue(x); queue.addQueue(y - 3); y = queue.front(); queue.deleteQueue(); cout << "x = " << x << endl; cout << "y = " << y << endl;

(Multiple Choice)
4.9/5
(33)

The postfix expression 3 5 + 2 ; 6 - = will generate an error, because it ____.

(Multiple Choice)
4.7/5
(46)

When a stack is implemented as an array, the array is empty if the value of stackTop is ____.

(Multiple Choice)
4.9/5
(46)

The addition and deletion of elements of a stack occurs only at the ____ of the stack.

(Multiple Choice)
4.8/5
(43)

What is the output of the following code? queueType<int> queue; int x, y; x = 2; y = 6; queue.addQueue(x); queue.addQueue(y); x = queue.front(); queue.deleteQueue(); queue.addQueue(x + 2); queue.addQueue(x); queue.addQueue(y - 3); while (!queue.isEmptyQueue()) { \quad cout << queue.front() << " "; \quad queue.deleteQueue(); } cout << endl

(Multiple Choice)
4.9/5
(39)
Showing 41 - 50 of 50
close modal

Filters

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