Convert following infix expression to the prefix expression.
a - b + c * (d / e - (f + g))
Answer Posted / elle
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
=-ab+*cV
=X+Y where X=-ab,*cV=Y
=+XY
=+-ab*cV
=+-ab*c-TS
=+-ab*c-/de+fg
Is This Answer Correct ? | 41 Yes | 7 No |
Post New Answer View All Answers
Explain the Queue
Define outdegree of a graph?
How do you find the complexity of a bubble sort?
What is a data structure? What are the types of data structures?
Is hashtable better than dictionary?
Advanced problems related to Data Structures were asked
What is merge sort and how it works?
What does quick sort do?
How would you implement two stacks using a single array?
What is difference between treeset hashset linkedhashset?
How can I study data structures and algorithms?
Why is arraylist used?
What is the difference between hashset and hashtable?
In tree construction which is the suitable efficient data structure?
Write an algorithm for inserting and deleting an element from doubly linked list?