NOTATION IN STACK
Notation me bhi stack ko display kiya jata hai. Notation mainly 3 kind ke hote hai.
1.prefix notation :prefix nonation vo notation hai jaha par operator operand se pahale aata hai.
example=
+AB
jaha A AUR B operands hai aur + operator
2.Infix Notation: Infix Notation me operands ke bich me operator hota hai.
example=
A+B
3.Postfix Notation: Postfix Notation vah nonation hai jaha par operator operand ke bad aate hai.
example
AB+
Precedence of operator:
highest =Exponentiation(|)
next highest =multiplication(*)
division(/)
lowest =addition(+)&
subtraction(-)
Conversion into Infix to postfix Notation
A+B*C(Infix notation)
A+(B*C)
A+(BC*)\\B*C KO POSTFIX NOTATION ME CHANGE KIYA GAYA .AB BC* EK OPERAND HAI AUR A EK OPERAND HAI. SO POSTFIX EXPRESSION HOGA---
ABC*+ .....ANSWER
Conversion into infix to prefix notation
a*b+c
first solve multiplication because multiplication ki precedence high hai.
(a*b)+c
(*ab)+c
+*abc ........answer
Krish tripathi(Gaurav)
Comments
Post a Comment