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 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)
Stacks are useful data structures for algorithms that work __________ with the __________ saved element in the series.
(Multiple Choice)
4.7/5
(35)
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)
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)
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)
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)