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


Please Help Members By Posting Answers For Below Questions

Define balance factor of a node in avl tree?

587


Is hashtable fail fast?

436


Which is better array or linked list?

470


do records fall under linear or non linear data structures?

1306


What is nsmutablearray?

450






Define ancestor and descendant ?

538


How to excel in data structures and algorithms?

518


What is the height of an empty tree?

529


What are the goals of data structure?

690


What is meant by int?

511


How do I use quick sort?

485


How do you sort elements in an arraylist?

460


What data type is enum?

479


What is arraylist load factor?

502


Why is hashmap faster?

473