Prashnikaप्रश्निका
Code
About
‹ Back to the paper

Question 2(c)

2 marks

Computer ScienceISC 2018 Computer Science Paper 1One wordData structures

Answer the following.

Convert the following infix notation to postfix form: A + ( B - C * ( D / E ) * F )

Convert the following infix notation to postfix form: $A + ( B - C * ( D / E ) * F )$
Open in the Infix to postfix converter

Answer

Answer

$A + ( B - C * ( D / E ) * F )$ Converting using the standard operator-precedence (stack-based) algorithm (verified by running the conversion in code): $D/E \to DE/$ $C*(D/E) \to C\,DE/\,* = CDE/*$ $C*(D/E)*F \to CDE/*\,F\,* = CDE/*F*$ $B - [C*(D/E)*F] \to B\,CDE/*F*\,- = BCDE/*F*-$ $A + [B-C*(D/E)*F] \to A\,BCDE/*F*-\,+$ Postfix: $A\;B\;C\;D\;E\;/\;*\;F\;*\;-\;+$