

MCQOPTIONS
Saved Bookmarks
This section includes 17 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. |
From the given expression tree, identify the infix expression, evaluate it and choose the correct result. |
A. | 5 |
B. | 10 |
C. | 12 |
D. | 16 |
Answer» D. 16 | |
2. |
Evaluate the following infix expression using algorithm and choose the correct answer. a+b*c-d/e^f where a=1, b=2, c=3, d=4, e=2, f=2. |
A. | 6 |
B. | 8 |
C. | 9 |
D. | 7 |
Answer» B. 8 | |
3. |
Using the evaluation of infix expression, evaluate a^b+c and choose the correct answer. (a=2, b=2, c=2) |
A. | 12 |
B. | 8 |
C. | 10 |
D. | 6 |
Answer» E. | |
4. |
Evaluate the following statement using infix evaluation algorithm and choose the correct answer. 4*2+3-5/5 |
A. | 10 |
B. | 11 |
C. | 16 |
D. | 12 |
Answer» B. 11 | |
5. |
Evaluate the following and choose the correct answer.a/b+c*d where a=4, b=2, c=2, d=1. |
A. | 1 |
B. | 4 |
C. | 5 |
D. | 2 |
Answer» C. 5 | |
6. |
Of the following choices, which operator has the lowest precedence? |
A. | ^ |
B. | + |
C. | / |
D. | # |
Answer» E. | |
7. |
EVALUATE_THE_FOLLOWING_STATEMENT_USING_INFIX_EVALUATION_ALGORITHM_AND_CHOOSE_THE_CORRECT_ANSWER._4*2+3-5/5?$ |
A. | 10 |
B. | 11 |
C. | 16 |
D. | 12 |
Answer» B. 11 | |
8. |
Evaluate the following infix expression using algorithm and choose the correct answer. a+b*c-d/e^f where a=1, b=2, c=3, d=4, e=2, f=2.$ |
A. | 6 |
B. | 8 |
C. | 9 |
D. | 7 |
Answer» B. 8 | |
9. |
Using the evaluation of infix expression, evaluate a^b+c and choose the correct answer. (a=2, b=2, c=2)$ |
A. | 12 |
B. | 8 |
C. | 10 |
D. | 6 |
Answer» E. | |
10. |
Evaluate the following and choose the correct answer? |
A. | |
B. | 1 |
C. | 4 |
Answer» C. 4 | |
11. |
The system throws an error if parentheses are encountered in an infix expression evaluation algorithm. |
A. | True |
B. | False |
Answer» C. | |
12. |
Evaluation of infix expression is done based on precedence of operators. |
A. | True |
B. | False |
Answer» B. False | |
13. |
Evaluate the following statement using infix evaluation algorithm and choose the correct answer. 1+2*3-2 |
A. | 3 |
B. | 6 |
C. | 5 |
D. | 4 |
Answer» D. 4 | |
14. |
Which of the following statement is incorrect with respect to evaluation of infix expression algorithm? |
A. | Operand is pushed on to the stack |
B. | If the precedence of operator is higher, pop two operands and evaluate |
C. | If the precedence of operator is lower, pop two operands and evaluate |
D. | The result is pushed on to the operand stack |
Answer» C. If the precedence of operator is lower, pop two operands and evaluate | |
15. |
Identify the infix expression from the list of options given below. |
A. | a/b+(c-d) |
B. | abc*+d+ab+cd+*ce-f- |
C. | ab-c- |
D. | +ab |
Answer» B. abc*+d+ab+cd+*ce-f- | |
16. |
How many passes does the evaluation of infix expression algorithm makes through the input? |
A. | One |
B. | Two |
C. | Three |
D. | Four |
Answer» B. Two | |
17. |
How many stacks are required for applying evaluation of infix expression algorithm? |
A. | one |
B. | two |
C. | three |
D. | four |
Answer» C. three | |