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
Q. Write down the recursive function to count the number of the nodes in the binary tree.    A n s . R ecursive Function to count no. of Nodes in Binary Tree is writt

Binary tree creation struct NODE { struct NODE *left; int value; struct NODE *right; }; create_tree( struct NODE *curr, struct NODE *new ) { if(new->val

Question 1 Write the different characteristics of an algorithm Question 2 Explain in brief the asymptotic notations Question 3 Write an algorithm of insertion sort and e

multilist representation of graph

explain two strategies to implement state charts with the help of an example of each.

Q. Describe the basic concept of binary search technique? Is it more efficient than the sequential search?         Ans : The bin ary search technique:- This tec

Define about the inheritance hierarchy Languages Eiffel and D provide constructs in language for invariants and pre- and post conditions which are compiled into the code and ar

State about the pre- and post conditions Programmers can easily document other pre- and post conditions and class invariants, though, and insert code to check most value preco

A binary search tree (BST), which may sometimes also be named a sorted or ordered binary tree, is an edge based binary tree data structure which has the following functionalities:

Enumerate about the carrier set members Ruby is written in C, so carrier set members (which is, individual symbols) are implemented as fixed-size arrays of characters (which is