Exam 18: Stacks and Queues

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

What is the output of the following code? What is the output of the following code?

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

C

A(n) ____ is a list of homogenous elements in which the addition and deletion of elements occurs only at one end.

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

A

When a stack is implemented as an array, the array is empty if the value of stackTop is ____.

Free
(Multiple Choice)
4.8/5
(75)
Correct Answer:
Verified

A

In evaluating a postfix expression, when an equal sign (=) is encountered, how many elements must the stack contain so that no error is generated?

(Multiple Choice)
4.8/5
(79)

In a(n) ____________________ simulation, the clock is implemented as a counter, and the passage of, say, one minute can be implemented by incrementing the counter by 1.

(Short Answer)
4.9/5
(73)

A stack is a(n) ____ data structure.

(Multiple Choice)
4.9/5
(84)

In the array representation of a stack, the stack is initialized simply by setting stackTop to ____________________.

(Short Answer)
4.7/5
(74)

The postfix expression 3 5 + 2 ; 6 - = will generate an error, because it ____.

(Multiple Choice)
4.9/5
(74)

The postfix expression 14 2 5 + = will generate an error, because ____.

(Multiple Choice)
4.8/5
(71)

The elements at the ____________________ of the stack have been in the stack the longest.

(Short Answer)
4.8/5
(78)

In the array representation of a stack, if a value called stackTop indicates the number of elements in the stack, then stackTop-1 points to the top item of the stack.

(True/False)
5.0/5
(74)

The bottom element of the stack is the last element added to the stack.

(True/False)
4.9/5
(73)

The ____ element of the stack is the last element added to the stack.

(Multiple Choice)
4.9/5
(71)

In ____________________ notation, operators are written after the operands.

(Short Answer)
5.0/5
(71)

To describe a queuing system, we use the term ____ for the object receiving the service.

(Multiple Choice)
4.9/5
(81)

A queue is a First In First Out data structure.

(True/False)
4.8/5
(78)

In a queuing system, every customer has a customer number, arrival time, ____________________ time, transaction time, and departure time.

(Short Answer)
4.8/5
(81)

Popping an element from an empty stack is called ____.

(Multiple Choice)
4.8/5
(90)

The following expression (a - b) * (c + d) is equivalent to which of the following postfix expressions?

(Multiple Choice)
4.8/5
(89)

The postfix expression 2 4 6 * + 15 - 21 7 / + = evaluates to ____.

(Multiple Choice)
4.7/5
(70)
Showing 1 - 20 of 42
close modal

Filters

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