Infix expression into the postfix expression, Data Structure & Algorithms

Q. Convert the given infix expression into the postfix expression (also Show the steps)

A ∗ (B + D)/ E - F(G + H / k )

Ans.

Steps showing Infix to Post fix

 

Symbol

Postfix String

Opstk

A

A

 

*

A

*

(

A

*(

B

AB

*(

+

AB

*(+

D

ABD

*(+

)

ABD+

*(

/

ABD+*

/

E

ABD+*E

/

-

ABD+*E/

-

F

ABD+*E/F

-

*

ABD+*E/F

-

(

ABD+*E/F

-(

G

ABD+*E/FG

-(

+

ABD+*E/FG

-(+

H

ABD+*E/FGH

-(+

/

ABD+*E/FGH

-(+/

K

ABD+*E/FGHK

-(+/

)

ABD+*E/FGHK/+-

 

Posted Date: 7/12/2012 8:40:05 AM | Location : United States







Related Discussions:- Infix expression into the postfix expression, Assignment Help, Ask Question on Infix expression into the postfix expression, Get Answer, Expert's Help, Infix expression into the postfix expression Discussions

Write discussion on Infix expression into the postfix expression
Your posts are moderated
Related Questions
What is an algorithm?  What are the characteristics of a good algorithm? An algorithm is "a step-by-step process for accomplishing some task'' An algorithm can be given in many

1. Start 2. Get h 3. If h T=288.15+(h*-0.0065) 4. else if h T=216.65 5. else if h T=216.65+(h*0.001) 6. else if h T=228.65+(h*0.0028) 7. else if h T=270.65 8.

Describe different methods of developing algorithms with examples.

How to create an General Tree and how to search general tree?

Diffuse Illumination Diffuse illumination means light that comes from all directions not from one particular source. Think about the light of a grey cloudy day as compared to

An interesting application or implementation of trees is the playing of games such as tie-tac-toe, chess, nim, kalam, chess, go etc. We can depict the sequence of possible moves

Q. Convert the following given Infix expression to Postfix form using the stack function: x + y * z + ( p * q + r ) * s , Follow general precedence rule and suppose tha

Compare zero-address, one-address, two-address, and three-address machines by writing programs to compute: Y = (A – B X C) / (D + E X F) for each of the four machines. The inst

What is complexity of an algorithm? What is the basic relation between the time and space complexities of an algorithm? Justify your answer by giving an example.

Implement a linear-expected-time algorithm for selecting the k th smallest element Algorithm description 1. If |S| = 1, then k = 1 and return the element in S as the an