Converting an infix expression into a postfix expression, Data Structure & Algorithms

Q. Illustrate the steps for converting the infix expression into the postfix expression

 

for the given expression  (a + b)∗ (c + d)/(e + f ) ↑ g .                                                   

 

Ans:

The infix expression can be converted to postfix expression as follows: (a+b)*(c+d)/(e+f)^g

=(ab+)*(cd+)/(ef+)^g

 

=(ab+)*(cd+)/(ef+g^)

 

=(ab+cd+*)/(ef+g^)

 

=(ab+cd+*ef+g^/)

The postfix expression is given as:-

(ab+cd+*ef+g^/)

Posted Date: 7/10/2012 6:18:54 AM | Location : United States







Related Discussions:- Converting an infix expression into a postfix expression, Assignment Help, Ask Question on Converting an infix expression into a postfix expression, Get Answer, Expert's Help, Converting an infix expression into a postfix expression Discussions

Write discussion on Converting an infix expression into a postfix expression
Your posts are moderated
Related Questions
Define Prim's Algorithm Prim's  algorithm  is  a  greedy  algorithm  for  constructing  a  minimum  spanning  tree  of  a  weighted linked graph. It works by attaching to a bef

Each of the comparison in the binary search decrease the number of possible candidates where the key value can be searched by a factor of 2 as the array is divided into two halves

Define tractable and intractable problems Problems that can be solved in polynomial time are known as tractable problems, problems that cannot be solved in polynomial time are

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

Write an algorithm in form of a flowchart that takes temperatures input over a 100 day period (once per day) and outputs the number of days when temperature was below 20C and numbe

You have to sort a list L having of a sorted list followed by a few "random" elements. Which sorting methods would be especially suitable for this type of task?   Insertion sort

In the earlier unit, we have discussed about the arrays. Arrays are data structures of fixed size. Insertion & deletion involves reshuffling of array elements. Thus, arraymanipulat

adjacency multilist

Pre-order Traversal The method of doing a pre-order traversal iteratively then has the several steps(suppose that a stack is available to hold pointers to the appropriate nodes

how multiple stacks can be implemented using one dimensional array