+1 vote
in Data Structures & Algorithms I by (110k points)
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

My question comes from Evaluation of an Infix Expression (Not Parenthesized) in chapter Application of Stacks of Data Structures & Algorithms I

The question was asked during an online interview.

1 Answer

+1 vote
by (408k points)
selected by
Best answer
The correct option is (a) 10

The best I can explain: 4*2 and 5/5 are evaluated first and then, 8+3-1 is evaluated and the result is obtained as 10.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.