Exam 17: Stacks and Queues

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

A queue is a data structure in which the elements are ____.

Free
(Multiple Choice)
4.9/5
(34)
Correct Answer:
Verified

A

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

Free
(Multiple Choice)
4.9/5
(41)
Correct Answer:
Verified

A

If you try to add a new item to a full stack,the resulting condition is called a(n)____.

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

B

In the linked implementation of stacks,the memory to store the stack elements is allocated statically.

(True/False)
4.9/5
(44)

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

(Multiple Choice)
4.8/5
(28)

The ____________________ constructor is called when a stack object is passed as a (value)parameter to a function.

(Short Answer)
4.7/5
(48)

The ____ element of the stack is the last element added to the stack.

(Multiple Choice)
4.9/5
(32)

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

(Short Answer)
5.0/5
(30)

What is the output of the following code? stackType<int> stack; Int x,y; x = 4; y = 2; stack.push(6); stack.push(x); stack.push(x + 1); y = stack.top(); stack.pop(); stack.push(x + y); x = stack.top(); stack.pop(); cout << "x = " << x << endl;

(Multiple Choice)
4.8/5
(42)

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

(Multiple Choice)
4.9/5
(40)

In the late 1950s,the Australian philosopher and early computer scientist Charles L.Hamblin proposed a scheme in which the operators follow the operands (postfix operators),resulting in the ____________________ notation.

(Short Answer)
4.8/5
(31)

The default constructor for the linked implementation of a stack initializes the stack to an empty state when a stack object is declared.

(True/False)
4.8/5
(47)

The ____________________ elements of a stack and queue should not be accessed directly.

(Short Answer)
4.9/5
(40)

A technique in which one system models the behavior of another system is called ____.

(Multiple Choice)
4.8/5
(38)

The postfix expression 5 6 + 4 * 10 5 / - = evaluates to ____.

(Multiple Choice)
4.7/5
(30)

The postfix expression 14 2 5 + = will generate an error,because ____.

(Multiple Choice)
4.9/5
(31)

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

(Multiple Choice)
4.8/5
(35)

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

(Multiple Choice)
4.8/5
(41)

The bottom element of the stack is the last element added to the stack.

(True/False)
4.9/5
(35)

What is the output of the following code? stackType<int> stack; Int x,y; x = 5; y = 3; stack.push(4); stack.push(x); stack.push(x + 1); y = stack.top(); stack.pop(); stack.push(x + y); x = stack.top(); stack.pop(); cout << "x = " << x << endl; cout << "y = " << y << endl;

(Multiple Choice)
4.7/5
(35)
Showing 1 - 20 of 50
close modal

Filters

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