Exam 7: Stacks

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

StackInterface provides the specifications for ______.

(Multiple Choice)
4.9/5
(29)

If a stack is used in a nonrecursive solution to the HPAir problem,when is it necessary to backtrack from a city?

(Essay)
4.9/5
(34)

The push operation of the ADT stack can throw a StackException.

(True/False)
4.9/5
(36)

What is the difference between the stack pop and peek operations?

(Essay)
4.9/5
(37)

The peek operation of the ADT stack changes the stack.

(True/False)
4.9/5
(33)

If 5 items are added to a stack,the first item to be removed from the stack is the first item that was added to the stack.

(True/False)
4.7/5
(41)

What is the value of the following postfix expression: 5 2 - 8 4 + *?

(Multiple Choice)
4.8/5
(41)

The push operation throws a StackException when it tries to ______.

(Multiple Choice)
4.9/5
(40)

When a recursive call to a method occurs,the compiler's implementation must remember all of the following information EXCEPT ______.

(Multiple Choice)
4.9/5
(38)

Which of the following is the postfix form of the infix expression: (a +b)* c / d

(Multiple Choice)
4.8/5
(36)

The ______ method of the ADT stack adds an item to the top of the stack.

(Multiple Choice)
4.9/5
(38)

What are the three facts about converting from infix expressions to postfix expressions?

(Essay)
4.8/5
(31)

What is meant by the first in,first out (FIFO)property?

(Essay)
5.0/5
(31)

In a graph that represents the flight map for the HPAir problem,if a flight exists from city C1 to city C2,then the path from C1 to C2 is called a _______.

(Multiple Choice)
4.8/5
(42)

The item that is removed first from a stack is called the ______ of the stack.

(Multiple Choice)
4.8/5
(46)

The pop operation throws a StackException when it tries to ______.

(Multiple Choice)
4.8/5
(43)

Describe an example of a game in which the logic of the game makes use of a stack.

(Essay)
5.0/5
(37)

Which of the following methods of the ADT stack accepts a parameter?

(Multiple Choice)
4.8/5
(37)

Explain how a stack can be used to determine if an infix expression is correctly parenthesized.

(Essay)
4.8/5
(38)

Suppose we begin with an empty stack,and perform the following operations: push 7,push 2,push 9,push 6,pop,pop,peek,push 1,push 3,peek,push 8,pop,peek,pop,pop,push 5,push 4,pop,pop,pop,push 8.What is contained on the stack when we are done? Write out the contents from top to bottom.

(Essay)
4.9/5
(46)
Showing 41 - 60 of 60
close modal

Filters

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