

MCQOPTIONS
Saved Bookmarks
This section includes 16 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures and Algorithms knowledge and support exam preparation. Choose a topic below to get started.
1. |
Here is an infix expression: 4 + 3*(6*3-12). Suppose that we are using the usual stack algorithm to convert the expression from infix to postfix notation. The maximum number of symbols that will appear on the stack AT ONE TIME during the conversion of this expression? |
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 |
Answer» E. | |
2. |
What is the value of the postfix expression 6 3 2 4 + – *? |
A. | 1 |
B. | 40 |
C. | 74 |
D. | -18 |
Answer» E. | |
3. |
Consider the usual algorithm for determining whether a sequence of parentheses is balanced. Suppose that you run the algorithm on a sequence that contains 2 left parentheses and 3 right parentheses (in some order). The maximum number of parentheses that appear on the stack AT ANY ONE TIME during the computation? |
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 or more |
Answer» C. 3 | |
4. |
Consider the usual algorithm for determining whether a sequence of parentheses is balanced. The maximum number of parentheses that appear on the stack AT ANY ONE TIME when the algorithm analyzes: (()(())(()))? |
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 or more |
Answer» D. 4 or more | |
5. |
Which of the following is not the application of stack? |
A. | A parentheses balancing program |
B. | Tracking of local variables at run time |
C. | Compiler Syntax Analyzer |
D. | Data Transfer between two asynchronous process |
Answer» E. | |
6. |
Entries in a stack are “ordered”. What is the meaning of this statement? |
A. | A collection of stacks is sortable |
B. | Stack entries may be compared with the ‘<‘ operation |
C. | The entries are stored in a linked list |
D. | There is a Sequential entry that is one by one |
Answer» E. | |
7. |
Pushing an element into stack already having five elements and stack size of 5, then stack becomes ___________ |
A. | Overflow |
B. | Crash |
C. | Underflow |
D. | User flow |
Answer» B. Crash | |
8. |
In a stack, if a user tries to remove an element from an empty stack it is called _________ |
A. | Underflow |
B. | Empty collection |
C. | Overflow |
D. | Garbage Collection |
Answer» B. Empty collection | |
9. |
WHAT_IS_THE_VALUE_OF_THE_POSTFIX_EXPRESSION_6_3_2_4_+_‚ÄÖ√Ñ√∂‚ÀÖ√Ë‚ÀÖ¬®_*:?$# |
A. | Something between -5 and -15 |
B. | Something between 5 and -5 |
C. | Something between 5 and 15 |
D. | Something between 15 and 100 |
Answer» E. | |
10. |
Consider the usual algorithm for determining whether a sequence of parentheses is balanced. |
A. | (())(())) are: |
B. | 1 |
C. | 2 |
D. | 3 |
Answer» D. 3 | |
11. |
Which of the following applications may use a stack? |
A. | A parentheses balancing program |
B. | Tracking of local variables at run time |
C. | Compiler Syntax Analyzer |
D. | All of the mentioned |
Answer» E. | |
12. |
Entries in a stack are “ordered”. What is the meaning of this statement?$ |
A. | A collection of stacks is sortable |
B. | Stack entries may be compared with the ‘<‘ operation |
C. | The entries are stored in a linked list |
D. | There is a Sequential entry that is one by one |
Answer» E. | |
13. |
Pushing an element into stack already having five elements and stack size of 5 , then stack becomes |
A. | Overflow |
B. | Crash |
C. | Underflow |
D. | User flow |
Answer» B. Crash | |
14. |
In a stack, if a user tries to remove an element from empty stack it is called _________ |
A. | Underflow |
B. | Empty collection |
C. | Overflow |
D. | Garbage Collection |
Answer» B. Empty collection | |
15. |
Process of removing an element from stack is called __________ |
A. | Create |
B. | Push |
C. | Evaluation |
D. | Pod |
Answer» E. | |
16. |
Process of inserting an element in stack is called ____________ |
A. | Create |
B. | Push |
C. | Evaluation |
D. | Pop |
Answer» C. Evaluation | |