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
A connected graph is a graph wherein path exists among every pair of vertices. A strongly connected graph is a directed graph wherein every pair of distinct vertices is connecte

A representation of an array structure is a mapping of the (abstract) array with elements of type T onto the store which is an array with elements of type BYTE. The array could be

Q. Using the following given inorder and preorder traversal reconstruct a binary tree Inorder sequence is D, G, B, H, E, A, F, I, C

Explain an efficient and effective way of storing two symmetric matrices of the same order in the memory. A n-square matrix array will be symmetric if a[j][k]=a[k][j] for all j

Retrieval of information is made simpler when it is stored into some predefined order. Therefore, Sorting is a very important computer application activity. Several sorting algorit

how to implement prims algorithm dynamically

Objectives The purpose of this project is to give you significant exposure to Binary Search Trees (BST), tree traversals, and recursive code. Background An arbitrary BST i

Define the term 'complexity of an algorithm; Complexity of an algorithm is the calculate of analysis of algorithm. Analyzing an algorithm means predicting the resources that th

Complexity is the rate at which the needed storage or consumed time rise as a function of the problem size. The absolute growth based on the machine utilized to execute the program

Implementation of Stack :- Stacks can be executed in the 2 ways: a)  Arrays b)  Linked List