Filters
Question type

Study Flashcards

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


A) zero
B) one
C) nonzero
D) equal to the size of the array

Correct Answer

verifed

verified

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


A) top
B) bottom
C) head
D) tail

Correct Answer

verifed

verified

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


A) override
B) overflow
C) overload
D) underflow

Correct Answer

verifed

verified

B

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

Correct Answer

verifed

verified

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


A) contains an illegal operator
B) does not have enough operands
C) has too many operands
D) has too many operators

Correct Answer

verifed

verified

A

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

Correct Answer

verifed

verified

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.

Correct Answer

verifed

verified

Reverse Po...

View Answer

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

Correct Answer

verifed

verified

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


A) it contains an illegal operator
B) it does not have enough operands
C) it has too many operators
D) there will be too many elements in the stack when the equal sign is encountered

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

Simulation...

View Answer

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;


A) x = 5
y = 6
B) x = 4
y = 3
C) x = 5
y = 3
D) x = 11
y = 6

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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


A) added to the rear and deleted from the front
B) added to and deleted from the rear
C) added to and deleted from the front
D) added and deleted in the middle

Correct Answer

verifed

verified

A

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


A) client
B) server
C) customer
D) provider

Correct Answer

verifed

verified

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


A) 10
B) 30
C) 42
D) 44

Correct Answer

verifed

verified

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


A) head
B) bottom
C) top
D) middle

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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


A) mapped
B) nested
C) queued
D) linked

Correct Answer

verifed

verified

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;


A) x = 4
B) x = 5
C) x = 6
D) x = 9

Correct Answer

verifed

verified

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


A) imitation
B) recursion
C) simulation
D) stimulation

Correct Answer

verifed

verified

Showing 1 - 20 of 50

Related Exams

Show Answer