Exam 7: Stacks

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

The equation 17 46 + is an example of postfix form.

Free
(True/False)
4.8/5
(36)
Correct Answer:
Verified

True

In the following code that defines the push method for the array-based stack, what is the missing code? def push (self, item): < missing code > Self.size += 1

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

B

A stack structure is a built-in part of the Python language.

Free
(True/False)
4.9/5
(33)
Correct Answer:
Verified

False

A token in the postfix expression evaluation algorithm is an operand or operator.

(True/False)
4.8/5
(32)

Which of the following is NOT an example of a stack in everyday life?

(Multiple Choice)
4.9/5
(37)

The operator in an infix expression follows the operands.

(True/False)
4.9/5
(39)

Which of the following is true about a postfix expression?

(Multiple Choice)
4.8/5
(36)

With a stack, you always access the item that has been most recently added.

(True/False)
4.9/5
(37)

Which of the following begins in a predefined starting state and then moves from state to state in search of a desired ending state?

(Multiple Choice)
4.9/5
(34)

What is the function of the PVM?

(Multiple Choice)
4.7/5
(37)

When using a stack to evaluate the balance of brackets and parentheses in an expression, what is the first step?

(Multiple Choice)
4.7/5
(42)

What is the resulting postfix expression from the following infix expression? (12 + 5) * 2 - 3

(Multiple Choice)
4.7/5
(29)

What is the resulting infix expression from the following postfix expression? 17 4 - 6 + 8 *

(Multiple Choice)
4.8/5
(36)

In the linked implementation of a stack, what type of helper function simplifies the __iter__ method?

(Multiple Choice)
4.9/5
(34)

If the current state of the stack is [ x, y, z ] where x is the bottom of the stack and z is the top of the stack, what is the state of the stack and the value returned after a pop operation?

(Multiple Choice)
4.9/5
(41)

If the entire postfix expression is 9 1 4 + - 2 *, what is the final value?

(Multiple Choice)
4.9/5
(39)

In what way doesn't the Python list data structure accurately emulate a stack?

(Multiple Choice)
4.8/5
(30)

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

(True/False)
4.8/5
(40)

Stacks adhere to a LIFO protocol.

(True/False)
4.9/5
(32)

Access to a stack is restricted to the bottom end.

(True/False)
4.9/5
(38)
Showing 1 - 20 of 50
close modal

Filters

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