Exam 19: Stacks and Queues
Exam 1: Introduction to Computers and Programming47 Questions
Exam 2: Introduction to C62 Questions
Exam 3: Expressions and Interactivity45 Questions
Exam 4: Making Decisions51 Questions
Exam 5: Loops and Files60 Questions
Exam 6: Functions49 Questions
Exam 7: Arrays and Vectors56 Questions
Exam 8: Searching and Sorting Arrays30 Questions
Exam 9: Pointers47 Questions
Exam 10: Characters, C-Strings, and More About the String Class47 Questions
Exam 11: Structured Data46 Questions
Exam 12: Advanced File Operations38 Questions
Exam 13: Introduction to Classes54 Questions
Exam 14: More About Classes46 Questions
Exam 15: Inheritance, Polymorphism, and Virtual Functions43 Questions
Exam 16: Exceptions and Templates36 Questions
Exam 17: The Standard Template Library38 Questions
Exam 18: Linked Lists41 Questions
Exam 19: Stacks and Queues47 Questions
Exam 20: Recursion27 Questions
Exam 21: Binary Trees39 Questions
Select questions type
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:
C
The STL provides containers for deque and queue.
Free
(True/False)
4.7/5
(26)
Correct Answer:
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:
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)
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)
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)
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)
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)