Question: Answer The Following Multiple Choice Questions And Choose the Correct Answer (1-4). The operation that adds a new item to a stack is... Question 1
Answer The Following Multiple Choice Questions And Choose the Correct Answer (1-4).
The operation that adds a new item to a stack is...
Question 1 options:
| 1. | push |
| 2. | insert |
| 3. | pop |
| 4. | remote |
Question 2:
A stack is one kind of ____ data structure.
Question 2 options:
| 1. | FIFO |
| 2. | LIFO |
| 3. | FINO |
| 4. | all of the above |
Question 3:
When you run the following code:
stack
Question 3 options:
| 1. | assert A will fail |
| 2. | assert B will fail |
| 3. | assert C will fail |
| 4. | it will finish without any of the asserts failing |
Question 4:
When you run the following code:
stack
Question 4 options:
| 1. | assert A will fail |
| 2. | assert B will fail |
| 3. | assert C will fail |
| 4. | it will finish without any of the asserts failing |
Question 5:
The stack::top method returns by reference. One reason for this is that...
Question 5 options:
| 1. | it wouldn't be possible to return the item by value |
| 2. | it avoids making a copy of the item being returned |
| 3. | it means the item will continue to exist if the stack is destroyed |
| 4. | the caller would otherwise have to free the item manually |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
