Exam 18: Stacks and Queues

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

If you are using a compiler that is older than C++ 11, be sure to put spaces between the angled brackets that appear next to each other when defining a stack.

(True/False)
4.8/5
(34)

The ________ operation allows an item to be removed from a stack.

(Multiple Choice)
4.8/5
(39)

In a static stack class, the constructor function can dynamically allocate memory for the stack array.

(True/False)
4.8/5
(24)

The Standard Template Library offers a stack template that may be implemented as a:

(Multiple Choice)
4.8/5
(45)

In the following code, assume the myStack object is a stack that can hold integers, and that value is an int variable. (The lines are numbered for reference purposes.)In the following code, assume the myStack object is a stack that can hold integers, and that value is an int variable. (The lines are numbered for reference purposes.)  Assume that the pop function, called in lines 4 and 6, stores the number popped from the stack in the value variable. What will the statement in line 7 display? Assume that the pop function, called in lines 4 and 6, stores the number popped from the stack in the value variable. What will the statement in line 7 display?

(Multiple Choice)
4.7/5
(41)

The programmer must declare in advance the size of a dynamic stack or queue.

(True/False)
4.9/5
(48)

In a dequeue operation, the element at the ________ of the queue is removed.

(Multiple Choice)
4.9/5
(51)

The pop function in the stack template does not retrieve the value from the top of the stack. It merely removes it.

(True/False)
4.9/5
(34)

A static queue can be implemented as a ________.

(Multiple Choice)
4.9/5
(33)

This is a container that provides quick access to elements at the front and the back of the list.

(Multiple Choice)
4.9/5
(32)

Push and pop are the two most common queue operations.

(True/False)
4.8/5
(40)

The first item placed onto a stack is always the last item removed from the stack.

(True/False)
4.7/5
(35)

Queues that are implemented as arrays are called ________ queues.

(Multiple Choice)
4.8/5
(40)

The STL provides containers for deque and queue.

(True/False)
4.9/5
(34)

Stacks are useful data structures for algorithms that work ________ with the ________ saved element in the series.

(Multiple Choice)
5.0/5
(42)

When an element is added to a queue, it is added to the rear. When an element is removed, it is removed from the ________.

(Multiple Choice)
4.8/5
(26)

In the following code, assume the myQueue object is a queue that can hold integers, and that value is an int variable. (The lines are numbered for reference purposes.) In the following code, assume the myQueue object is a queue that can hold integers, and that value is an int variable. (The lines are numbered for reference purposes.)   Assume that the dequeue function, called in line 4, stores the number removed from the queue in the value variable. What will the statement in line 5 display? Assume that the dequeue function, called in line 4, stores the number removed from the queue in the value variable. What will the statement in line 5 display?

(Multiple Choice)
4.9/5
(46)

A stack that is implemented as a linked list is known as a deque.

(True/False)
4.9/5
(34)

Static stacks have a ________ size, and are implemented as ________.

(Multiple Choice)
4.9/5
(33)

A ________ is processed in a manner similar to customers standing in a grocery check-out line-the first customer in line is the first served.

(Multiple Choice)
4.7/5
(38)
Showing 21 - 40 of 47
close modal

Filters

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