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

 

 Help authour, Buy PDF Ebook   >>>Click Here<<<

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

Click on any option to know the CORRECT ANSWERS

Question 6
Evaluation of infix expression is done based on precedence of operators.
A
True
B
False
Library science Questions answers

Question 6 Explanation: 
During evaluation of infix expression, the operators with higher precedence are evaluated first, followed by operators with lower precedence.

Question 7
Of the following choice s, which operator has the lowest precedence?
A
^
B
+
C
/
D
#
Home science Questions answers

Question 7 Explanation: 
The operator with the lowest precedence is #, preceded by +, / and then ^.

Question 8
The system throws an error if parentheses are encountered in an infix expression evaluation algorithm.
A
True
B
False
UPSC Questions answers

Question 8 Explanation: 
The algorithm holds good for infix expression with parentheses. The system does not throw error.

Question 9
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
Data interpretation (DI) Questions answers

Question 9 Explanation: 
* and / have higher priority. Hence, they are evaluated first. Then, + is evaluated. Hence, 2+2=4.

Question 10
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
Home science Questions answers

Question 10 Explanation: 
4*2 and 5/5 are evaluated first and then, 8+3-1 is evaluated and the result is obtained as 10.

There are 10 questions to complete.

 

 Download all FREE PDF Ebook >>>CLICK HERE<<<