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.8/5
(29)
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
(34)
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.7/5
(33)
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.9/5
(38)

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
(26)

A stack is a(n) ____ data structure.

(Multiple Choice)
4.9/5
(43)

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

(Short Answer)
4.7/5
(31)

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

(Multiple Choice)
4.9/5
(33)

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

(Multiple Choice)
4.7/5
(34)

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

(Short Answer)
4.9/5
(36)

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)
4.9/5
(36)

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

(True/False)
4.9/5
(31)

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

(Multiple Choice)
4.9/5
(32)

In ____________________ notation, operators are written after the operands.

(Short Answer)
4.9/5
(29)

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

(Multiple Choice)
4.9/5
(35)

A queue is a First In First Out data structure.

(True/False)
4.9/5
(33)

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

(Short Answer)
4.8/5
(36)

Popping an element from an empty stack is called ____.

(Multiple Choice)
4.7/5
(48)

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

(Multiple Choice)
4.9/5
(46)

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

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

Filters

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