If we solve an infix expression in to postfix expression with braces and without braces will both of them produce same result?
Example:
- ((2+8)x9)-(5x(5+2))
- 2+8*9-5*5+2
Will both of these examples produce the same results? If No, then why not?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In general, it will not produce the same result, due to the precedence of the operations. For example, if you define
*to have higher precedence than+and-, then*must be evaluated before+or-, which changes how the expression is calculated, and also changes the post-fix representation.