122 views

2 Answers

1 1 vote

Prefix expression:

$\texttt{+ * 2 3 / 8 4}$

This represents the expression tree:

Postfix means postorder traversal:

Left $\rightarrow$ Right $\rightarrow$ Root

Left subtree $\texttt{* 2 3}$ becomes:

$\texttt{2 3 *}$

Right subtree $\texttt{/ 8 4}$ becomes:

$\texttt{8 4 /}$

Then the root $\texttt{+}$ comes at the end.

So the postfix expression is:

$\texttt{2 3 * 8 4 / +}$

Correct Option: A

Answer:
Position:
Show:

Related questions

2 2 votes
2 2 answers
155
155 views
GO Classes asked Jul 9
155 views
Consider the following postfix expression:$\texttt{1 2 3 + 4 5 * * +}$Which of the following fully parenthesized infix expressions is equivalent to it?$\texttt{( 1 + ( ( ...
2 2 votes
2 2 answers
123
123 views
3 3 votes
2 2 answers
134
134 views
GO Classes asked Jul 9
134 views
Convert the following fully parenthesized infix expression into postfix form:$\texttt{( 2 + ( ( 3 + 4 ) * ( 5 * 6 ) ) )}$Which of the following is the correct postfix exp...
2 2 votes
2 2 answers
147
147 views
GO Classes asked Jul 9
147 views
For the expression:$\texttt{2 * 3 + 8 / 4}$Assume the expression tree has $\texttt{+}$ as the root, $\texttt{*}$ as the left subtree root, and $\texttt{/}$ as the right s...