PRASHNIKAप्रश्निका
Back to the paper

Convert the following infix notation to prefix notation.

Computer Science20232 marksOne word
Convert the following infix notation to prefix notation. $(A - B) / C * (D + E)$

Answer

Answer

AI
$(A - B) / C * (D + E)$; / and * have equal priority and are evaluated left to right, so it is $((A - B) / C) * (D + E)$. Step 1: $(A - B) \to -AB$ and $(D + E) \to +DE$ Step 2: $(-AB) / C \to /-ABC$ Step 3: $(/-ABC) * (+DE) \to */-ABC+DE$ Prefix: $* \, / \, - \, A \, B \, C \, + \, D \, E$
Data structures

From ISC 2023 Computer Science Paper 1, question 2(i).