Exam 7: Stacks

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

The operation ____ reinitializes the stack to an empty state.

Free
(Multiple Choice)
4.7/5
(35)
Correct Answer:
Verified

C

If we compare the push function of the stack with the insertFirst function for general lists, we see that the algorithms to implement these operations are similar.

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

True

In a linked list implementation of a stack, only a fixed number of elements can be pushed onto the stack.

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

False

An element can be removed from the stack only if there is something in the stack, and an element can be added to the stack only if there is room.

(True/False)
5.0/5
(43)

The function ____, if possible, evaluates the expression and leaves the result in the stack.

(Multiple Choice)
4.8/5
(26)

The operation pop returns the top element of the stack.

(True/False)
4.8/5
(37)

If the postfix expression is error free, the function ____ outputs the result.

(Multiple Choice)
4.8/5
(32)

The ____ operation checks whether the stack is empty.

(Multiple Choice)
4.9/5
(32)

The operation top removes the top element of the stack.

(True/False)
4.8/5
(39)

The function copyStack makes a copy of a stack.

(True/False)
4.9/5
(41)

A stack is a list of homogenous elements in which the addition and deletion of elements occurs only at one end.

(True/False)
4.9/5
(43)

The function ____ is called whenever an error is discovered in the expression.

(Multiple Choice)
4.8/5
(36)

The function evaluateExpression evaluates each ____ expression.

(Multiple Choice)
4.8/5
(35)

The postfix expression 6 3 + 2 * = evaluates to 18.

(True/False)
4.8/5
(37)

Stacks can be used to print a list backwards without using recursion.

(True/False)
4.8/5
(29)

The ____ can be used to determine whether two stacks are identical.

(Multiple Choice)
4.7/5
(48)

A client's program can include a header file via the ____ statement.

(Multiple Choice)
4.9/5
(29)

The function ____ makes an identical copy of a stack.

(Multiple Choice)
4.8/5
(39)

The ____ operation checks whether the stack is full.

(Multiple Choice)
4.9/5
(31)

The operation push removes the bottom element from the stack.

(True/False)
4.8/5
(34)
Showing 1 - 20 of 44
close modal

Filters

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