Exam 17: Stacks and Queues
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Input/Output50 Questions
Exam 4: Control Structures I (Selection)50 Questions
Exam 5: Control Structures II (Repetition)50 Questions
Exam 6: User-Defined Functions50 Questions
Exam 7: User-Defined Simple Data Types, Namespaces, and the string Type50 Questions
Exam 8: Arrays and Strings50 Questions
Exam 9: Records (structs)50 Questions
Exam 10: Classes and Data Abstraction50 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Linked Lists50 Questions
Exam 17: Stacks and Queues50 Questions
Exam 18: Searching and Sorting Algorithms50 Questions
Exam 19: Binary Trees50 Questions
Exam 20: Graphs50 Questions
Exam 21: Standard Template Library (STL)50 Questions
Select questions type
What is the output of the following code? queueType<int> queue;
Int x,y;
x = 2;
y = 6;
queue.addQueue(x);
queue.addQueue(y);
x = queue.front();
queue.deleteQueue();
queue.addQueue(x + 2);
queue.addQueue(x);
queue.addQueue(y - 3);
while (!queue.isEmptyQueue())
{
cout << queue.front()<< " ";
queue.deleteQueue();
}
cout << endl;
(Multiple Choice)
4.9/5
(33)
What is the output of the following code? queueType<int> queue;
Int x,y;
x = 2;
y = 3;
queue.addQueue(x);
queue.addQueue(y);
x = queue.front();
queue.deleteQueue();
queue.addQueue(x + 2);
queue.addQueue(x);
queue.addQueue(y - 3);
y = queue.front();
queue.deleteQueue();
cout << "x = " << x << endl;
cout << "y = " << y << endl;
(Multiple Choice)
4.8/5
(38)
In the linked implementation of stacks,the stack is ____________________ only if you run out of memory space.
(Short Answer)
5.0/5
(39)
The postfix expression 2 4 6 * + 15 - 21 7 / + = evaluates to ____.
(Multiple Choice)
4.8/5
(41)
In a queuing system,we use a(n)____________________ variable to set the status of the server.
(Short Answer)
4.8/5
(31)
In the array representation of a stack,if a value called stackTop indicates the number of elements in the stack,then stackTop-1 points to the top item of the stack.
(True/False)
4.9/5
(37)
When describing a queuing system,we use the term ____________________ time to refer to the time it takes to serve a customer.
(Short Answer)
4.7/5
(27)
You can perform the add operation,called ____,to add an element onto the stack.
(Multiple Choice)
4.9/5
(35)
The elements at the ____________________ of a stack have been in the stack the longest.
(Short Answer)
4.8/5
(44)
To describe a queuing system,we use the term ____ for the object that provides the service.
(Multiple Choice)
4.7/5
(35)
Postfix notation requires the use of parentheses to enforce operator precedence.
(True/False)
4.9/5
(36)
The expression a + b is the same in both infix notation and postfix notation.
(True/False)
4.8/5
(31)
In a(n)____________________ array,the first array position immediately follows the last array position.
(Short Answer)
4.8/5
(38)
In evaluating a postfix expression,when an equal sign (=)is encountered,how many elements must the stack contain so that no error is generated?
(Multiple Choice)
4.7/5
(42)
The infix expression
(a + b)* (c - d / e)+ f
is equivalent to the postfix expression
ab + cde /-* f +
(True/False)
4.9/5
(39)
A(n)____________________ system consists of servers and queues of objects waiting to be served.
(Short Answer)
4.9/5
(38)
In the array representation of a stack,an unlimited number of elements can be pushed onto the stack.
(True/False)
4.9/5
(26)
Showing 21 - 40 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)