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

Explain the common uses of tree database.

524


Does arraylist maintain insertion order?

477


Define articulation point?

731


What is sorting problem?

492


In tree construction which is the suitable efficient data structure?

555






What is circular queue in data structure?

459


Write a code for dynamic allocation of array.

601


What are the applications of b-tree?

561


Is a list an array?

459


Which sorting algorithm is used in arrays sort?

510


How does a hashtable work?

477


What is difference between data type and data structure?

423


Differentiate between file and structure storage structure.

523


What are the major data structures used in the network data model?

663


What is the best case complexity of bubble sort?

490