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
Design a datastructure to represent the movement of a knight on a chess board
What is variable size arrays?and why we use it?
You want to insert a new item in a binary search tree. How would you do it?
How do you do a mergesort?
Can we remove element from arraylist while iterating?
Is it possible to insert different type of elements in a stack? How?
Is collection a class or interface?
What is the complexity of sorting algorithm?
how to display Singly Linked List from First to Last?
How do you do a heap sort?
Is it legal to initialize list like this?
Why do we need searching algorithms?
How to copy an array into another array?
Can arraylist contain duplicates?
What does arrays tostring do?