Computer Science, asked by souryakalivarapu1, 1 month ago

Find Prefix and Postfix for the below Infix problem statement:
286310
60831
Infix Expression: 11 + 20/5* ( 20 - 15 )^6^5
O Prefix Expression: 11 20 5 20 15 - ^^*/+6 5
Postfix Expression: +11 /^^-20 * 5 20 15 6 5
O Prefix Expression: +11/20 * 5^^ - 20 15 6 5
Postfix Expression: 11 20 5 20 15 - 6 5^^*/+
60831016 72
60831016
O Prefix Expression: 11 20 5 20 15 - 6 5^^*/+
Postfix Expression: +11 / 20 * 5^^ - 20 15 6 5
جما
O Prefix Expression: 11 20 15 20 5 - ^^*6 5/+
Postfix Expression: +20 / 11 * 5 - 20 ^^15 6 5
(1831016.72
0831016.7
Mork for Dova Nout
clear Doonanca
Version : 17.05.21
thp​

Answers

Answered by s1261aditi5623
5

Answer:

don't send unknown questions sir pls

Answered by mad210215
2

Prefix and Postfix :

Explanation:

  • Prefix: An expression is said to be the prefix expression if the operator appears in the expression before the operands.
  • Postfix: An expression is termed the postfix expression if the operator appears in the expression after the operands.

Steps for infix to prefix conversion:

  • Step 1: Reverse the infix expression i.e A+B*C can become C*B+A. Note while reversing every '(' will become ')' and every ')' becomes '('.
  • Step 2: Obtain the “nearly” postfix expression of the changed expression i.e CB*A+.
  • Step 3: Reverse the postfix expression.

Steps for infix to postfix conversion:

  • Step 1: Scan the given Infix expression from the left to right direction.
  • Step 2: Initialize an empty stack.
  • Step 3: If the incoming character is an operand, add it to the postfix string.
  • Step 4: If the incoming character is an operator and push the character to stack if the stack is empty.

∴ According to above rule,

Infix Expression: 11 + 20/5* ( 20 - 15 )^6^5

Postfix  Expression: 11 20 5 / 20 15 - 6 5 ^ ^ * +

Prefix Expression: +11 / 20*5^ - 20 15 ^65

Similar questions