Convert following infix expression to the prefix expression.
a - b + c * (d / e - (f + g))
Answer Posted / 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 |
Post New Answer View All Answers
What are the different types of sorting? Explain the difference between them.
Which sort is stable?
What is an iterative algorithm?
What is a treemap used for?
Which is the parent class of list
Why do we use dynamic arrays?
What are linear and non linear data structures?
Explain the uses of b+ tree.
Define linear probing?
Write the steps involved in the insertion and deletion of an element in the stack.
Tell me the difference between the character array and a string.
How do you find a string is anagram or not?
Mention the data structures which are used in graph implementation.
Why is sorting important?
Is arraylist fail fast?