Filters
Question type

What protocol are stacks said to adhere to?


A) LIFO
B) FIFO
C) one-to-one
D) many-to-one

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

Correct Answer

verifed

verified

If the portion of the postfix expression scanned so far is 7 6 2 +, what is the result when the operator is applied to the operands?


A) 8
B) 15
C) 13
D) 9

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

Correct Answer

verifed

verified

What are the two fields required by the Node class in the linked implementation of a stack?


A) prev, items
B) prev, data
C) items, next
D) data, next

E) A) and C)
F) A) and B)

Correct Answer

verifed

verified

A tuple is an immutable collection type.

Correct Answer

verifed

verified

The operator in a postfix expression follows the operands.

A) True
B) False

Correct Answer

verifed

verified

When using a stack to determine if brackets are balanced in an expression, the stack should not be empty when you reach the end of the expression.

A) True
B) False

Correct Answer

verifed

verified

Because of their linear structure, stacks can only be implemented using linked structures.

A) True
B) False

Correct Answer

verifed

verified

The pop operation for a stack raises an error if the stack is empty.

A) True
B) False

Correct Answer

verifed

verified

What is the first step in the algorithm to evaluate an arithmetic expression?


A) transform the expression from postfix form to infix form
B) calculate the result from the postfix expression
C) calculate the result from the infix expression
D) transform the expression from infix form to postfix form

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

Correct Answer

verifed

verified

Which of the following is true about stacks?


A) they are analogous to a row of books on a shelf
B) items are always added to the bottom
C) access is restricted to just one end
D) most implementations allow access to the middle

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

Correct Answer

verifed

verified

Showing 41 - 50 of 50

Related Exams

Show Answer