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.9/5
(68)
Correct Answer:
Verified

C

The STL provides containers for deque and queue.

Free
(True/False)
4.7/5
(68)
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
(69)
Correct Answer:
Verified

A

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

(Multiple Choice)
4.9/5
(85)

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

(Multiple Choice)
4.8/5
(81)

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

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

(Multiple Choice)
4.9/5
(65)

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

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

(Multiple Choice)
4.9/5
(68)

Which of the following is a double-ended queue?

(Multiple Choice)
4.8/5
(72)

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

(Multiple Choice)
4.9/5
(75)

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

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

(Multiple Choice)
4.9/5
(77)

A stack can be adapted to store __________ data types.

(Multiple Choice)
4.9/5
(78)

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.8/5
(74)

The two most common queue operations are push and pop.

(True/False)
4.8/5
(75)

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

(Multiple Choice)
4.8/5
(92)

A dynamic stack starts as an empty linked list.

(True/False)
4.8/5
(69)

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

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
(83)
Showing 1 - 20 of 47
close modal

Filters

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