Data Structure Questions and Answers-Evaluation of an Infix Expression (Not Parenthesized)

YOU CAN DOWNLOAD 200+ SUBJECTS PDF BOOK FOR COMPETITIVE EXAMINATIONS

CLICK HERE TO DOWNLOAD

Data Structure Questions and Answers-Evaluation of an Infix Expression (Not Parenthesized)

Question 11 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
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
Question 11 Explanation: 
^ has the highest precedence. Hence, 2^2 is evaluated and then 4+2 gives 6.

Question 12 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
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
Question 12 Explanation: 
^ has the highest order of precedence. Hence, 2^2 is evaluated first, and then, 2*3 and 4/4 are evaluated. Therefore, 1+6-1=6.

Question 13 [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
From the given expression tree, identify the infix expression, evaluate it and choose the correct result.
A
5
B
10
C
12
D
16
Question 13 Explanation: 
From the given expression tree, the result of the infix expression is evaluated to be 12.

There are 13 questions to complete.