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
A queue is a data structure in which the elements are ____.
Free
(Multiple Choice)
4.9/5
(34)
Correct Answer:
A
The postfix expression 3 5 + 2 ; 6 - = will generate an error,because it ____.
Free
(Multiple Choice)
4.9/5
(41)
Correct Answer:
A
If you try to add a new item to a full stack,the resulting condition is called a(n)____.
Free
(Multiple Choice)
4.8/5
(34)
Correct Answer:
B
In the linked implementation of stacks,the memory to store the stack elements is allocated statically.
(True/False)
4.9/5
(44)
When a stack is implemented as an array,the array is empty if the value of stackTop is ____.
(Multiple Choice)
4.8/5
(28)
The ____________________ constructor is called when a stack object is passed as a (value)parameter to a function.
(Short Answer)
4.7/5
(48)
The ____ element of the stack is the last element added to the stack.
(Multiple Choice)
4.9/5
(32)
____________________ techniques are used when it is too expensive or dangerous to experiment with real systems.
(Short Answer)
5.0/5
(30)
What is the output of the following code?
stackType<int> stack;
Int x,y;
x = 4;
y = 2;
stack.push(6);
stack.push(x);
stack.push(x + 1);
y = stack.top();
stack.pop();
stack.push(x + y);
x = stack.top();
stack.pop();
cout << "x = " << x << endl;
(Multiple Choice)
4.8/5
(42)
A stack can be implemented as either an array or a(n)____ structure.
(Multiple Choice)
4.9/5
(40)
In the late 1950s,the Australian philosopher and early computer scientist Charles L.Hamblin proposed a scheme in which the operators follow the operands (postfix operators),resulting in the ____________________ notation.
(Short Answer)
4.8/5
(31)
The default constructor for the linked implementation of a stack initializes the stack to an empty state when a stack object is declared.
(True/False)
4.8/5
(47)
The ____________________ elements of a stack and queue should not be accessed directly.
(Short Answer)
4.9/5
(40)
A technique in which one system models the behavior of another system is called ____.
(Multiple Choice)
4.8/5
(38)
The postfix expression 5 6 + 4 * 10 5 / - = evaluates to ____.
(Multiple Choice)
4.7/5
(30)
The postfix expression 14 2 5 + = will generate an error,because ____.
(Multiple Choice)
4.9/5
(31)
The addition and deletion of elements of the stack occurs only at the ____ of the stack.
(Multiple Choice)
4.8/5
(35)
To describe a queuing system,we use the term ____ for the object receiving the service.
(Multiple Choice)
4.8/5
(41)
The bottom element of the stack is the last element added to the stack.
(True/False)
4.9/5
(35)
What is the output of the following code? stackType<int> stack;
Int x,y;
x = 5;
y = 3;
stack.push(4);
stack.push(x);
stack.push(x + 1);
y = stack.top();
stack.pop();
stack.push(x + y);
x = stack.top();
stack.pop();
cout << "x = " << x << endl;
cout << "y = " << y << endl;
(Multiple Choice)
4.7/5
(35)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)