Exam 7: Stacks
Exam 1: Basic Python Programming51 Questions
Exam 2: An Overview of Collections50 Questions
Exam 3: Searching, Sorting, and Complexity Analysis50 Questions
Exam 4: Arrays and Linked Structures50 Questions
Exam 5: Interfaces, Implementations, and Polymorphism50 Questions
Exam 6: Inheritance and Abstract Classes50 Questions
Exam 7: Stacks50 Questions
Exam 8: Queues50 Questions
Exam 9: Lists50 Questions
Exam 10: Trees50 Questions
Exam 11: Sets and Dictionaries50 Questions
Exam 12: Graphs50 Questions
Select questions type
The equation 17 46 + is an example of postfix form.
Free
(True/False)
4.8/5
(36)
Correct Answer:
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:
B
A stack structure is a built-in part of the Python language.
Free
(True/False)
4.9/5
(33)
Correct Answer:
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)
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)
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)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)