Filters
Question type

Study Flashcards

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

E) None of the above
F) All of the above

Correct Answer

verifed

verified

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


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

E) A) and B)
F) None of the above

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

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

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

E) A) and C)
F) C) and D)

Correct Answer

verifed

verified

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

Correct Answer

verifed

verified

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


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

E) None of the above
F) B) and C)

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

E) All of the above
F) None of the above

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

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

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

E) A) and B)
F) B) and D)

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.

A) True
B) False

Correct Answer

verifed

verified

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

E) C) and D)
F) A) and C)

Correct Answer

verifed

verified

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

E) A) and B)
F) All of the above

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

E) C) and D)
F) B) and C)

Correct Answer

verifed

verified

A

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


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

E) C) and D)
F) B) and D)

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

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

A

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


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

E) B) and C)
F) C) and D)

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

E) A) and B)
F) B) and D)

Correct Answer

verifed

verified

B

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

A) True
B) False

Correct Answer

verifed

verified

Showing 1 - 20 of 50

Related Exams

Show Answer