Exam 7: Stacks

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

What is the restriction that the array-based implementation of a stack places on the push operation?

Free
(Essay)
4.8/5
(31)
Correct Answer:
Verified

The restriction that is placed by the array-based implementation of a stack is that it prevents the push operation from adding an item to the stack if the stack's size limit,which is the size of the array,has been reached.

When infix expressions are converted to postfix expressions,the operands always stay in the same order with respect to one another.

Free
(True/False)
4.7/5
(32)
Correct Answer:
Verified

True

The ______ method of the ADT stack retrieves the top of the stack,but does not change the stack.

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

D

Which of the following strings contains balanced braces?

(Multiple Choice)
4.7/5
(47)

Suppose an infix expression contains parentheses as grouping symbols.Is it still possible to convert this expression into postfix notation?

(Short Answer)
4.8/5
(44)

What are the factors which determine the placement of operators when an infix expression is converted to a postfix expression?

(Essay)
4.8/5
(33)

The last-in,first-out (LIFO)property is found in the ADT ______.

(Multiple Choice)
4.7/5
(37)

A program can use the operations of the ADT stack without knowing how the operations are implemented.

(True/False)
4.9/5
(34)

Calls to methods that throw StackException must be enclosed in try blocks.

(True/False)
4.9/5
(40)

What is an exhaustive search?

(Essay)
4.8/5
(33)

In a reference-based implementation of a stack,it is necessary to call the isFull method before calling the push method.

(True/False)
4.9/5
(35)

In a reference-based implementation of a stack,the stack can grow and shrink dynamically.

(True/False)
4.8/5
(36)

When does the push operation throw a StackException?

(Essay)
4.8/5
(39)

A client can access all the elements of a stack.

(True/False)
4.8/5
(36)

What is the corrected input if the following line is typed on a keyboard: yww←dshr←←wd←e (where ← represents the backspace character)?

(Multiple Choice)
4.7/5
(37)

In the StackInterface class,the push method accepts as its parameter an item that is an instance of ______.

(Multiple Choice)
4.8/5
(42)

An algorithm that uses a stack to implement a nonrecursive solution to the HPAir problem reaches the conclusion that there is no path from an origin city to a destination city only after ______.

(Multiple Choice)
4.8/5
(42)

A stack has a first in,first out property.

(True/False)
4.8/5
(41)

What is meant by the last-in,first-out (LIFO)property?

(Essay)
4.8/5
(43)

The ______ method of the ADT stack retrieves and then removes the top of the stack.

(Multiple Choice)
4.9/5
(39)
Showing 1 - 20 of 60
close modal

Filters

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