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 |
Is bubble sort adaptive?
What type of algorithm is binary search?
Does treemap allow null keys?
What are the applications of b-tree?
What are hash tables good for?
Why heap sort is not used?
What are the advantages of modularity?
Why sorting is done?
What will be the output of below code?
how to find the number of possible tree in the given tree.
12 Answers Persistent, TCS, Wipro,
What do you mean by 2-3 tree?
How many different binary trees and binary search trees can be made from three nodes that contain the key values 1, 2 & 3?
28 Answers Accenture, Amazon, College School Exams Tests, iGate, Microsoft, TCS, Wipro,