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
Does hashset maintain order?
How to cut or remove an element from the array?
What are the scenarios in which an element can be inserted into the circular queue?
Is array size dynamic or fixed?
Which collection class is thread safe?
Which interface provides the capability to store objects using a key-value pair?
Model a data structure for a DFA that takes an event as parameter and performs a desired action.
What is the difference between hashmap and arraylist?
Explain the uses of matrix with an example?
Define linked lists?
What does args stand for?
What is the purpose of tochararray ()?
Define linked list data structure.
What is the Insertion Sort Code?.
What is declaring array?