Exam 17: Stacks and Queues

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

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()) { cout << queue.front()<< " "; queue.deleteQueue(); } cout << endl;

(Multiple Choice)
4.9/5
(33)

Popping an element from an empty stack is called ____.

(Multiple Choice)
4.8/5
(29)

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.8/5
(38)

In the linked implementation of stacks,the stack is ____________________ only if you run out of memory space.

(Short Answer)
5.0/5
(39)

The postfix expression 2 4 6 * + 15 - 21 7 / + = evaluates to ____.

(Multiple Choice)
4.8/5
(41)

In a queuing system,we use a(n)____________________ variable to set the status of the server.

(Short Answer)
4.8/5
(31)

In the array representation of a stack,if a value called stackTop indicates the number of elements in the stack,then stackTop-1 points to the top item of the stack.

(True/False)
4.9/5
(37)

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

(Short Answer)
4.7/5
(27)

You can perform the add operation,called ____,to add an element onto the stack.

(Multiple Choice)
4.9/5
(35)

The elements at the ____________________ of a stack have been in the stack the longest.

(Short Answer)
4.8/5
(44)

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

(Multiple Choice)
4.7/5
(35)

Postfix notation requires the use of parentheses to enforce operator precedence.

(True/False)
4.9/5
(36)

The expression a + b is the same in both infix notation and postfix notation.

(True/False)
4.8/5
(31)

In a(n)____________________ array,the first array position immediately follows the last array position.

(Short Answer)
4.8/5
(38)

In evaluating a postfix expression,when an equal sign (=)is encountered,how many elements must the stack contain so that no error is generated?

(Multiple Choice)
4.7/5
(42)

A stack is a(n)____ data structure.

(Multiple Choice)
4.9/5
(42)

The infix expression (a + b)* (c - d / e)+ f is equivalent to the postfix expression ab + cde /-* f +

(True/False)
4.9/5
(39)

A(n)____________________ system consists of servers and queues of objects waiting to be served.

(Short Answer)
4.9/5
(38)

An array is a(n)____________________ access data structure.

(Short Answer)
4.8/5
(39)

In the array representation of a stack,an unlimited number of elements can be pushed onto the stack.

(True/False)
4.9/5
(26)
Showing 21 - 40 of 50
close modal

Filters

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