
#1
 
 
Application of Stacks.. Infix post and prefix Application of Stacks.. Infix post and prefix September 22, 2008. Data Structure Expression:collection of operators and operands is called expression. i.e. in A+B A, B are operands and” +” is operator. Types of Expression: There are three types of Expression
In which operator is used between the operand a+b It is used in our common mathematical expressions. II) Postfix: In which operator is used after the operands. i.e. ab+ III) Prefix: In which the operator is used before the operands. I .e. +ab We use infix type in our daily life but the computer use the postfix or prefix, because it is easy for computer to calculate by using postfix or prefix. Without the conversion of postfix and prefix is not possible (Postfix ma jo show ho chukka ha usko prefix ma show krna ha to stack use krna para ga.) Usually C++ programming used postfix but their use depends on the language creator, either he use postfix or prefix type. Examples: Consider the precedence of the operator, the precedence is decreasing downwardly. ( ) $ (this symbol is used for power symbol in the book of Tenun Baum and in shaum series the power symbol is denoted by a arrow with upward direction.) /,* (both have same precedence) +, _ (both have same precedence) if there two operators with same precedence then computer start to solve the expression from left to right. Examples of Postfix: 1) a+bc ab+  c ab+c 2) a+b*c a + bc* (we consider the ‘bc*’ one term and ’a’ other term and ‘+’ is operator between them and apply the postfix method. aik color aik term o zahir krta ha.dusra color dusri term ko.in k dermean operators han.jesa k a+bc men a, b, c alag alag tems han.ya colorz manta apko smjhana k ley dey han ta k apko alheda terms ka pata chal jay.sir na her term k nichy line lagwai thi ta k her term alheda ho jay and hamen asani sa smajh a jay. ) abc* + 3) (a+b)/ (ef*c) ab+ / (ef*c) (idher a+b ma a, b alag alag terms thi.in k dermean + operator tha.operation k bad +ab ak term ban gai.Agy bhi yahi concept dea gaya ha.) ab+ / ( efc*) ab+ / efc* ab+ efc*/ 4) (a+b)/ (e$f*c) ab+ / (ef$ * c) ab+ / ef$c* ab+ef$c*/ 5) a+b/d*e$f+g a+b/d*ef$ +g a+ bd/ *ef$+g a+ bd/ef$ *+g abd/ef$* + + g abd/ef$*+g+ 6) (a+b)/ (d*e$f+g) This is exercise for you; its prefix solution will be given at the end. Example of Prefix: 1) a+b === +ab 2) a+bc +ab  c +abc 3) a+b/d*e$f+g a+b/d* $ef + g a+/bd* $ef + g a + */bd$ef + g +a*/bd$ef + g ++a*/bd$efg 4) (a+b)/ (d*e$f+g) +ab/(d*$ef + g) +ab /( *d$f + g) +ab/ +*d$fg /+ab+*d$fg
__________________ (¯`v´¯) `*.¸.*` ¸.*´¸.*´¨) ¸.*´¨) (¸.*´ (¸.Bzu Forum Don't cry because it's over, smile because it happened 
Tags 
ahmad, application, infix, lectures, post, prefix, programming, stacks 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)  
Thread Tools  Search this Thread 
Display Modes  Rate This Thread 
 
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Stacks in Data Structures  bonfire  BsTS 2nd Semester  0  26022011 11:50 PM 
How to post attached image inside the Post (Inline attachment)  .BZU.  Suggestion,Feedback and News about site  5  25092010 10:49 PM 
program of single array acting as multiple stacks  taha khan  Data Structure  2  28102008 09:06 PM 
BIT3]Assignments:Transform infix to post fix ?  .BZU.  Data Structure  2  29092008 01:40 AM 
Algorithms to convert the infix to postfix  .BZU.  Data Structure  1  26092008 10:01 PM 