Exam 19: Stacks and Queues

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

A(n) __________ is an abstract data type that stores and retrieves items in a last-in-first-out manner.

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

C

The STL provides containers for deque and queue.

Free
(True/False)
4.7/5
(26)
Correct Answer:
Verified

True

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 cout << value << endl; Assume that the dequeue function, called on line 4, stores the number removed from the queue in the value variable. What will the statement on line 5 display?

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

A

A __________ stack or queue is built around the linked list.

(Multiple Choice)
4.9/5
(37)

A queue is a data structure that stores and retrieves item in the __________ manner.

(Multiple Choice)
4.8/5
(29)

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

(Multiple Choice)
4.8/5
(38)

A __________ queue is more intuitive and easier to understand than a __________ queue.

(Multiple Choice)
4.8/5
(25)

For a compiler that is older than C++11 it is necessary to put spaces between the angled brackets that appear next to each other when defining a stack.

(True/False)
4.9/5
(36)

If data is transmitted faster than it can be processed, it can be held in a __________ for processing.

(Multiple Choice)
4.9/5
(31)

Which of the following is a double-ended queue?

(Multiple Choice)
4.8/5
(29)

The __________ operation allows an item to be removed from the stack.

(Multiple Choice)
4.9/5
(34)

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 myStack.push(3); 6 myStack.pop(value); 7 cout << value << endl; Assume that the pop function, called on lines 4 and 6, stores the number popped from the stack in the value variable. What will the statement on line 7 display?

(Multiple Choice)
4.8/5
(36)

Static stacks have a __________ size and are implemented as __________.

(Multiple Choice)
4.9/5
(27)

A stack can be adapted to store __________ data types.

(Multiple Choice)
4.9/5
(36)

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 myStack.pop(value); 6 myStack.pop(value); 7 cout << value << endl; Assume that the pop function, called on lines 4, 5, and 6, stores the number popped from the stack in the value variable. What will the statement on line 7 display?

(Multiple Choice)
4.9/5
(37)

The two most common queue operations are push and pop.

(True/False)
4.8/5
(27)

Select all that apply. The Standard Template Library offers a stack template that may be implemented as a(n)

(Multiple Choice)
4.8/5
(41)

A dynamic stack starts as an empty linked list.

(True/False)
4.8/5
(27)

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.enqueue(3); 6 myQueue.dequeue(value); 7 cout << value << endl; Assume that the dequeue function, called on lines 4 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
(34)

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

(Multiple Choice)
4.8/5
(33)
Showing 1 - 20 of 47
close modal

Filters

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