Convert following infix expression to the prefix expression.
a - b + c * (d / e - (f + g))
Answer Posted / naresh
first u need to reverse the given string like this..
))g+f(-e/d(*c+b-a..
after doing this, we need to consider a stack n insert symbolls into the stack whenever u encountered it in the string..
sequence of flow is:
g
f
+
e
d
/
-
c
*
b
+
a
-......
the string obtained is gf+ed/-c*b+a-..
u need to reverse the string for answer i.e
ans is -a+b*c-/de+fg..
| Is This Answer Correct ? | 28 Yes | 23 No |
Post New Answer View All Answers
How to get the index of an array element?
Which type of memory allocation is referred for linked list?
Is quicksort faster than merge sort?
Explain heapsort. What is its complexity?
Which language is best for data structures and algorithms?
What is the difference between sorting and classifying?
Define union-by-weight?
How do you reference all the elements in a one-dimension array?
What are different types of algorithms?
Is complete binary tree?
What is storage structure in data structure?
What is the heap in data structures?
What is difference between an Array and ArrayList?
Is it possible to increase size of array?
What is red black tree in data structure?