Convert following infix expression to the prefix expression.
a - b + c * (d / e - (f + g))
Answers were Sorted based on User's Feedback
Answer / p.divya poojitha
a-b+c*(/de-(+fg))
a-b+c*(t-s) if t=/de;s=+fg
a-b+c*(-ts)
-ab+*c-ts
+-ab*c-ts
sol is +-ab*c-/de+fg
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / deepshikha singh
first we solve() because it has greatest priority
step1 : a-b+c*(d/e-[+fg])
step2 : a-b+c*([/de]-[+fg])
step3 : a-b+c*[-/de+fg]
step4 : a-b+[*c-/de+fg]
step5 : a-[+b*c-/de+fg]
step6: -a+b*c-/de+fg
note :[] sign is use to differentiate two terms after applying
operations.
| Is This Answer Correct ? | 3 Yes | 9 No |
Answer / amit patra
=a-b+c*(d/e-(+fg)
=a-b+c*(/de-(+fg)
=a-b+c*(-/de+fg)
=a-b+c*-de+fg
=-ab+c*-de+fg
=*-+abcde+fg
| Is This Answer Correct ? | 1 Yes | 13 No |
Answer / piyush kumar
a-b+c*(d/e-(f+g))
=a-b+c*(/de-(+fg))
=a-b+c*(T-S) where T=/de,S=+fg
=a-b+c*-(TS)
=-ab+c*-(TS)
=-ab+c*V where V=-TS
=X+Y where X=-ab,c*V=Y
=+XY
=+-abc*V
=+-abc*-TS
=+-abc*-/de+fg
| Is This Answer Correct ? | 3 Yes | 16 No |
What are the different types of sorting in data structure?
No. of possible ordered trees with n nodes ? Please give formula (if any).
What is the difference between hashmap and linkedhashmap?
What are the scenarios in which an element can be inserted into the circular queue?
Is hashset thread safe?
What is storage structure in data structure?
Is linkedlist thread safe?
Calculate the efficiency of sequential search?
A list is ordered from smaller to largest when a sort is called. Which sort would take the shortest time to execute?
Does array sort mutate?
What is data type with example?
How to check array contains value or not?