Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Convert following infix expression to the prefix expression.
a - b + c * (d / e - (f + g))

Answer Posted / ashish

Algorithm for Infix to Prefix Conversion is
1. Reverse the given expression ...
2. Apply algorithm of infix to post-fix conversion...
3. Again reverse the expression after the post-fix conversion...


Infix Expression is => a - b + c * (d / e - (f + g))

step 1: => ( g + f ) - e / d ) * c + b- a

step 2: => apply post-fix ...

( ( g f + ) - e d / ) * c + b - a
( g f + e d / - ) * c + b - a
g f + e d / - c * + b - a
g f + e d / - c * b + - a
g f + e d / - c * b + a -

step 3: => final step reverse the expression ...

Prefix Expression = - a + b * c - / d e + f g

...
source :: http://scanftree.com/Data_Structure/infix-to-prefix

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between data type and data structure?

762


Why concurrenthashmap is fail safe?

912


What is unbounded queue?

862


Why it is important to have aligned addresses? What is the exception generated when there is a misaligned address?

838


What is the need of sorting?

848


Why do we use data structures?

834


How does a binary search work?

803


Can we change the size of an array at run time?

917


What do you mean by open addressing?

920


Differentiate between singly and doubly linked lists?

924


What is array define its types?

876


Can we declare array size as a negative number?

949


What is the difference between file structure and storage structure?

944


What is the difference between 1d and 2d array?

903


If we add enum constants to a sorted collection ( treemap , treeset ), what will be the order in which they will be maintained?

910