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

Question 2(i)

2 marks

Computer ScienceISC 2023 Specimen Computer Science Paper 1ConversionData structures

Answer the following.

Convert the following infix notation to postfix form. ( P / Q - R ) * ( S + T )

Convert the following infix notation to postfix form. $( P / Q - R ) * ( S + T )$
Open in the Infix to postfix converter

Answer

Answer

$(P/Q-R)*(S+T)$ Converting $(P/Q-R)$: push $($, output $P$, push $/$, output $Q$ (so far $PQ$), on seeing $-$ pop $/$ to output ($PQ/$) then push $-$, output $R$ ($PQ/R$), on $)$ pop $-$ ($PQ/R-$). Converting $(S+T)$: output $ST+$. Combine with $*$: $PQ/R- \;\; ST+ \;\; *$ Postfix: $PQ/R-ST+*$