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
I=PR/12 numbers of years : Interest Rate up to 1 years : 5.50 Up to 5 years : 6.50 More than 5 year : 6.75 please design an algorithm based on the above information

How To implement stack using two queues , analyze the running time of the stack operations ?

In the last section, we discussed regarding shortest path algorithm that starts with a single source and determines shortest path to all vertices in the graph. In this section, we

Asymptotic Analysis Asymptotic analysis is depending on the idea that as the problem size grows, the complexity can be defined as a simple proportionality to some known functio

The minimum cost spanning tree has broad applications in distinct fields. It represents several complicated real world problems such as: 1. Minimum distance for travelling all o

solve the following relation by recursive method: T(n)=2T(n^1/2)+log n

Before programming a problem solution those employees a stack, we have to decide how to represent a stack by using the data structures which exist in our programming language. Stac

Data Structure and Methods: Build an array structure to accomodate at least 10 elements. Provide routines for the following: An initializer. A routine to populate (

Records are mapped onto a computer store by simply juxtaposing their elements. The address of a component (field) r relative to the origin address of the record r is named the fiel

Q. Calculate that how many key comparisons and assignments an insertion sort makes in its worst case?        Ans: The worst case performance occurs in insertion