Execute algorithm to convert infix into post fix expression, Data Structure & Algorithms

Q. Execute your algorithm to convert the infix expression to the post fix expression with the given infix expression as input

Q = [(A + B)/(C + D) ↑ (E / F)]+ (G + H)/ I

 

Ans:

The given infix expression is as follows:-

Q = [(A + B) / (C + D) ^ (E + F)] + (G + H) / I

Symb               Stack                           Postfix Notation

[                    [

(                    [ (

A                  [ (                          A

+

[ ( +

 

B

[ ( +

AB

)

[

AB+

/

[ /

 

(

[ / (

 

C

[ / (

AB+C

+

[ / ( +

 

D

[ / ( +

AB+CD

)

[ /

AB+CD+

^

[ / ^

 

(

[ / ^ (

 

E

[ / ^ (

AB+CD+

/

[ / ^ ( /

AB+CD+

F

[ / ^

AB+CD+/

]

EMPTY

AB+CD+EF/^/

+

+

 

(

+ (

 

G

+ (

AB+CD+EF/^/G

+

+ ( +

 

H

+ ( +

AB+CD+EF/^/GH

)

+

AB+CD+EF/^/GH+

/

+ /

AB+CD+EF/^/GH+

I

+ /

AB+CD+EF/^/GH+I

POSTFIX is:-       AB+CD+EF/^/GH+I/+

Posted Date: 7/11/2012 1:21:35 AM | Location : United States







Related Discussions:- Execute algorithm to convert infix into post fix expression, Assignment Help, Ask Question on Execute algorithm to convert infix into post fix expression, Get Answer, Expert's Help, Execute algorithm to convert infix into post fix expression Discussions

Write discussion on Execute algorithm to convert infix into post fix expression
Your posts are moderated
Related Questions
P os t - o r d e r T r av er sal :  This can be done by both iteratively and recursively. The iterative solution would require a modification or alteration of the in-

In the last subsection, we have implemented a stack by using an array. While a stack is implemented by using arrays, it suffers from the basic restriction of an array - i.e., its s

A Binary Search Tree is binary tree which is either empty or a node having a key value, left child & right child. By analyzing the above definition, we notice that BST comes int

Let a be a well-formed formula. Let c be the number of binary logical operators in a. (Recall that ?, ?, ?, and ? are the binary logical operators). Let s be the number of proposit

How does cpu''s part tming and controls generate and controls signls in computer?

Explain about the Abstract data type Abstract data type (ADT) A set of values (the carrier set) and operations on those values

implement multiple stack in one dimensional array


Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

data structure for multiqueue