Exam 19: Stacks and Queues

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

A dynamic stack has a __________ size and is implemented as a(n) __________.

(Multiple Choice)
4.9/5
(33)

What does the following statement indicate? Stack< int, vector<int> > iStack;

(Multiple Choice)
4.8/5
(40)

Given the following code, assume the myQueue object is a queue that can hold integers and that value is an int variable. 1 myQueue.enqueue(0); 2 myQueue.enqueue(1); 3 myQueue.enqueue(2); 4 myQueue.dequeue(value); 5 myQueue.dequeue(value); 6 myQueue.dequeue(value); 7 cout << value << endl; Assume that the dequeue function, called on lines 4, 5, and 6, stores the number removed from the queue in the value variable. What will the statement on line 7 display?

(Multiple Choice)
4.8/5
(29)

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

(Multiple Choice)
4.7/5
(38)

A dynamic queue can be implemented as a

(Multiple Choice)
4.7/5
(37)

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

(Multiple Choice)
4.7/5
(35)

Stacks and queues can be implemented as arrays or linked lists.

(True/False)
4.9/5
(36)

Select all that apply. A practical application of the stack data type in a computer system is

(Multiple Choice)
4.9/5
(32)

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

(True/False)
4.9/5
(34)

The two most common queue operations are endeque and deque.

(True/False)
4.8/5
(28)

A real-world example of the queue data structure can be seen in a stack of cafeteria trays where the last tray pushed onto the stack is the first tray removed.

(True/False)
4.7/5
(36)

The __________ operation allows an item to be stored on a stack.

(Multiple Choice)
4.8/5
(36)

A dynamic stack may be implemented as a(n) __________ and can expand or shrink with each push or pop operation.

(Multiple Choice)
4.9/5
(34)

The two primary stack operations are

(Multiple Choice)
4.7/5
(38)

Two primary queue operations are

(Multiple Choice)
4.8/5
(34)

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

(Multiple Choice)
4.8/5
(38)

Given the following code, assume the myStack object is a stack that can hold integers and that value is an int variable. 1 myStack.push(0); 2 myStack.push(1); 3 myStack.push(2); 4 myStack.pop(value); 5 cout << value << endl; Assume that the pop function, called on line 4, stores the number popped from the stack in the value variable. What will the statement on line 5 display?

(Multiple Choice)
4.8/5
(33)

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

(True/False)
4.8/5
(37)

A stack queue can be implemented as a

(Multiple Choice)
4.9/5
(43)

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

(True/False)
4.7/5
(31)
Showing 21 - 40 of 47
close modal

Filters

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