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
What are different techniques for making hash function? Explain with example.
Which sorting method is slowest?
Define shortest path?
Is hashtable better than dictionary?
How does a binary search work?
Complete structure of hashmap, very detail description, along with the basic coding of the hashmap internal implementation.
Can I provide array size dynamically?
What are the properties of binary heap?
When would you use a hashmap?
What is meant by heap sort?
How do you sort an arraylist in descending order?
What's difference between stack and queue?
What is circular linked list?
Can we add duplicate keys in a hashmap?
Define a tree?