SlideShare a Scribd company logo
1 of 15
Dr. D. Y. Patil Pratishthan’s
D.Y. Patil College Of Engineering & Technology,
Kasaba Bawada, Kolhapur
A
Presentation On
“Polish Notation”
Presented By:
1.Daulmalik S. Mujawar.
2.Falaknaz N. Punekar.
3.Rohit Ugave.
4.Prajakta Suryavanshi.
Index
1. Abstract
2. Introduction
3. Problem Statement
4. Approaches to tackle
5. Algorithm and Flow chart
6. Important construct of PL used
7. Result : All Possible input and output
8. Conclusion
9. Application
10.References
Abstract
• To evaluate and simplifies the arithmetic expression given by
an user. The priorities are fixed in the project (^ then * / then +
-). The input string is given by user with minimum 2 operands
with 1 operator.
• Operator Precedence :-
Exponential Operator ^ Highest Precedence
Multiplication/ Division */ Next Precedence
Addition / Subtraction +- Least Precedence
Introduction
• Polish notation, also known as Polish prefix notation or simply prefix notation, is a
form of notation for logic, arithmetic, and algebra.
• Its distinguishing feature is that it places operators to the left of their operands.
• If the arty of the operators is fixed, the result is a syntax lacking parentheses or
other brackets that can still be parsed without ambiguity.
• The Polish logician Jan Łukasiewicz invented this notation in 1924 in order to
simplify sentential logic.
Introduction(cont..)
• Infix :- The infix notation is what we come across in our general mathematics,
where the operator is written in-between the operands.
– For E.g. :- A + B
• Prefix :- The notation in which operator is place before the operands. It is also
called as Polish notation.
– E.g. :- + A B
• Postfix :- The notation in which operator is place after the operands. It is also called
as Reverse Polish notation or simply Suffix Notation.
– E.g. :- A B +
Problem Statement
• Computer doesn’t understand the regular mathematical expression. So,
complier needs to converts the regular expression into polish (prefix) notation
expression for performing evaluation operation.
• Read an expression in Polish notation, To simplify the Polish notation
expression as much as possible.
Case 1: + 3 4
Case 2: - x x
Case 3: * - 6 + x -6 - - 9 6 * 0 c
7
- x x
* - 6 + x -6 - 3 * 0 c
APPROACHES TO TACKLE :
2.1Using Array
We use array, in which array acts as stack and push and pop operations are performed on array
stack.
Eg:-
Stc[20];
For(i=0;i<20;i++)
{
Scanf(“%d”,&a[i]);
}
2.2Using structure
In instead we can use structure to create stack and with top of stack.Object of a structure is
considered as stack, and members of structure defines top of stack, terminals and non-terminals.
Struct stack1{
Int tos=-1;
Char tr,ntr;
} s[100];
ALGORITHM
3.1 Logic:
1. Start.
2. Enter the mathematical expression in polish notation.
3. Check entered expression is Prefix. If NO, go to step 6
4. Evaluate the expression.
5. Display the result
6. End.
Start
Initialization
Evaluate
Expression
End
Check
expression
Is Prefix
NO
Yes
IMPORTANCE CONSTRUCTOR OF USED :
Work related to checking entered expression is prefix.
function’s used:
•isopnd (char)
This function is use to check the current element field is operand or not. If it’s a operand then it
will push on to the stack and pointer is move to ext position.
•isoprtr (char)
This function is use to check the current element field is operator or not. If it’s a operand then it
will push on to the stack and top is move to next position.
•evaluate (char, int, int)
This function is use to evaluate the given expression if two consecutive operator are pushed to the
stack and after that push two consecutive operands on to stack then it evaluate this expression.
•strlen()
This is a inbuilt function which is used to calculate the length of given expression.
SCREENSHOOT
For the Expression – X X
For the Expression * - 6 + x - 6- - 9 6 * 1 c
Conclusion
• For evaluating given arithmetic expression Calculator /
Computer needs simplified expressions. With the help of
polish notation, the complex notation gets simplifies.
• This Program will be used to simplify the complex
mathematical polish notation expressions. This makes
compiler to read the simplified expression effectively.
Application
• For evaluating given arithmetic expression.
• Calculator.
References / Bibliography
• Books
– Data Structures with C (Schaum's Outline Series) -by Seymour Lipschutz
– Let Us C (Computer Science) -by Yashavant P. Kanetkar
• Websites
– The ACM International Collegiate Programming Contest (ICPC)
https://icpc.baylor.edu/
– Stack Overflow
http://stackoverflow.com/
– Polish notation
https://en.wikipedia.org/wiki/Polish_notation
– Tutorials Point
http://www.tutorialspoint.com/data_structures_algorithms/expressionparsing.htm

More Related Content

What's hot

Operator overloading
Operator overloadingOperator overloading
Operator overloadingBurhan Ahmed
 
LR(1) and SLR(1) parsing
LR(1) and SLR(1) parsingLR(1) and SLR(1) parsing
LR(1) and SLR(1) parsingR Islam
 
Lexical analysis - Compiler Design
Lexical analysis - Compiler DesignLexical analysis - Compiler Design
Lexical analysis - Compiler DesignKuppusamy P
 
OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++Aabha Tiwari
 
16 subroutine
16 subroutine16 subroutine
16 subroutinefyjordan9
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C ProgrammingQazi Shahzad Ali
 
Oops practical file
Oops practical fileOops practical file
Oops practical fileAnkit Dixit
 
Types of function call
Types of function callTypes of function call
Types of function callArijitDhali
 
Parsing in Compiler Design
Parsing in Compiler DesignParsing in Compiler Design
Parsing in Compiler DesignAkhil Kaushik
 
Operator Precedence Grammar
Operator Precedence GrammarOperator Precedence Grammar
Operator Precedence GrammarHarisonFekadu
 
Bottom - Up Parsing
Bottom - Up ParsingBottom - Up Parsing
Bottom - Up Parsingkunj desai
 
C++ Pointers And References
C++ Pointers And ReferencesC++ Pointers And References
C++ Pointers And Referencesverisan
 
pointers,virtual functions and polymorphism
pointers,virtual functions and polymorphismpointers,virtual functions and polymorphism
pointers,virtual functions and polymorphismrattaj
 
Infix to postfix expression in ds
Infix to postfix expression in dsInfix to postfix expression in ds
Infix to postfix expression in dsRohini Mahajan
 

What's hot (20)

Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
LR(1) and SLR(1) parsing
LR(1) and SLR(1) parsingLR(1) and SLR(1) parsing
LR(1) and SLR(1) parsing
 
Module 11
Module 11Module 11
Module 11
 
Lexical analysis - Compiler Design
Lexical analysis - Compiler DesignLexical analysis - Compiler Design
Lexical analysis - Compiler Design
 
Top down parsing
Top down parsingTop down parsing
Top down parsing
 
Functions in c
Functions in cFunctions in c
Functions in c
 
14 Skip Lists
14 Skip Lists14 Skip Lists
14 Skip Lists
 
Introduction to C++
Introduction to C++Introduction to C++
Introduction to C++
 
OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++
 
16 subroutine
16 subroutine16 subroutine
16 subroutine
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
 
Oops practical file
Oops practical fileOops practical file
Oops practical file
 
Types of function call
Types of function callTypes of function call
Types of function call
 
Parsing in Compiler Design
Parsing in Compiler DesignParsing in Compiler Design
Parsing in Compiler Design
 
Operator Precedence Grammar
Operator Precedence GrammarOperator Precedence Grammar
Operator Precedence Grammar
 
Top down parsing
Top down parsingTop down parsing
Top down parsing
 
Bottom - Up Parsing
Bottom - Up ParsingBottom - Up Parsing
Bottom - Up Parsing
 
C++ Pointers And References
C++ Pointers And ReferencesC++ Pointers And References
C++ Pointers And References
 
pointers,virtual functions and polymorphism
pointers,virtual functions and polymorphismpointers,virtual functions and polymorphism
pointers,virtual functions and polymorphism
 
Infix to postfix expression in ds
Infix to postfix expression in dsInfix to postfix expression in ds
Infix to postfix expression in ds
 

Viewers also liked

Statements conclusions
Statements conclusionsStatements conclusions
Statements conclusionsMohammed Ali
 
Sitting arangements
Sitting arangementsSitting arangements
Sitting arangementsMohammed Ali
 
Pm arabic ch8 صياغة التقارير وغلق المشروع
Pm arabic ch8 صياغة التقارير وغلق المشروعPm arabic ch8 صياغة التقارير وغلق المشروع
Pm arabic ch8 صياغة التقارير وغلق المشروعkhalid Dahleez
 
Localization and internationalization principles power point by darlena pagan
Localization and internationalization principles power point by darlena paganLocalization and internationalization principles power point by darlena pagan
Localization and internationalization principles power point by darlena paganUSA Discussion Group
 
Pm arabic ch7 الموارد البشریة وإدارة فریق المشروع
Pm arabic ch7 الموارد البشریة وإدارة فریق المشروعPm arabic ch7 الموارد البشریة وإدارة فریق المشروع
Pm arabic ch7 الموارد البشریة وإدارة فریق المشروعkhalid Dahleez
 
Economic Situation Evaluation on Denmark
Economic Situation Evaluation on DenmarkEconomic Situation Evaluation on Denmark
Economic Situation Evaluation on DenmarkKhan Tanjeel Ahmed
 
Credit Management Practices of BDBL
Credit Management Practices of BDBLCredit Management Practices of BDBL
Credit Management Practices of BDBLKhan Tanjeel Ahmed
 
Sales promotion assignment
Sales promotion assignmentSales promotion assignment
Sales promotion assignmentMarke Greene
 
9 core activity we need to have a succesful project management
9 core activity we need to have a succesful project management9 core activity we need to have a succesful project management
9 core activity we need to have a succesful project managementMarke Greene
 
Chapter 6: Writing Objective Test Items
Chapter 6: Writing Objective Test ItemsChapter 6: Writing Objective Test Items
Chapter 6: Writing Objective Test ItemsSHELAMIE SANTILLAN
 
abdul sattar edhi
abdul sattar edhiabdul sattar edhi
abdul sattar edhiFahadi302
 
Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O SystemsWayne Jones Jnr
 
WordCamp Auckland 2017 summary
WordCamp Auckland 2017 summaryWordCamp Auckland 2017 summary
WordCamp Auckland 2017 summaryRalf Klis
 

Viewers also liked (20)

Cross domain
Cross domainCross domain
Cross domain
 
Statements conclusions
Statements conclusionsStatements conclusions
Statements conclusions
 
Sitting arangements
Sitting arangementsSitting arangements
Sitting arangements
 
Pm arabic ch8 صياغة التقارير وغلق المشروع
Pm arabic ch8 صياغة التقارير وغلق المشروعPm arabic ch8 صياغة التقارير وغلق المشروع
Pm arabic ch8 صياغة التقارير وغلق المشروع
 
Localization and internationalization principles power point by darlena pagan
Localization and internationalization principles power point by darlena paganLocalization and internationalization principles power point by darlena pagan
Localization and internationalization principles power point by darlena pagan
 
Pm arabic ch7 الموارد البشریة وإدارة فریق المشروع
Pm arabic ch7 الموارد البشریة وإدارة فریق المشروعPm arabic ch7 الموارد البشریة وإدارة فریق المشروع
Pm arabic ch7 الموارد البشریة وإدارة فریق المشروع
 
Economic Situation Evaluation on Denmark
Economic Situation Evaluation on DenmarkEconomic Situation Evaluation on Denmark
Economic Situation Evaluation on Denmark
 
Credit Management Practices of BDBL
Credit Management Practices of BDBLCredit Management Practices of BDBL
Credit Management Practices of BDBL
 
Alienware
AlienwareAlienware
Alienware
 
Sales promotion assignment
Sales promotion assignmentSales promotion assignment
Sales promotion assignment
 
9 core activity we need to have a succesful project management
9 core activity we need to have a succesful project management9 core activity we need to have a succesful project management
9 core activity we need to have a succesful project management
 
Coaching ontologico PIADE
Coaching ontologico PIADECoaching ontologico PIADE
Coaching ontologico PIADE
 
Introduccion a Triz.
Introduccion a Triz.Introduccion a Triz.
Introduccion a Triz.
 
Chapter 6: Writing Objective Test Items
Chapter 6: Writing Objective Test ItemsChapter 6: Writing Objective Test Items
Chapter 6: Writing Objective Test Items
 
abdul sattar edhi
abdul sattar edhiabdul sattar edhi
abdul sattar edhi
 
Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O Systems
 
Onsite Journal
Onsite JournalOnsite Journal
Onsite Journal
 
Gestión humana
Gestión humanaGestión humana
Gestión humana
 
WordCamp Auckland 2017 summary
WordCamp Auckland 2017 summaryWordCamp Auckland 2017 summary
WordCamp Auckland 2017 summary
 
Perico trepa por chile
Perico trepa por chilePerico trepa por chile
Perico trepa por chile
 

Similar to Polish

Unit 3 Stacks and Queues.pptx
Unit 3 Stacks and Queues.pptxUnit 3 Stacks and Queues.pptx
Unit 3 Stacks and Queues.pptxYogesh Pawar
 
Data Structures in C
Data Structures in CData Structures in C
Data Structures in CJabs6
 
Stack_Overview_Implementation_WithVode.pptx
Stack_Overview_Implementation_WithVode.pptxStack_Overview_Implementation_WithVode.pptx
Stack_Overview_Implementation_WithVode.pptxchandankumar364348
 
sweetu stacks.pdf
sweetu stacks.pdfsweetu stacks.pdf
sweetu stacks.pdfmohit476551
 
Unit II - LINEAR DATA STRUCTURES
Unit II -  LINEAR DATA STRUCTURESUnit II -  LINEAR DATA STRUCTURES
Unit II - LINEAR DATA STRUCTURESUsha Mahalingam
 
01 stack 20160908_jintaek_seo
01 stack 20160908_jintaek_seo01 stack 20160908_jintaek_seo
01 stack 20160908_jintaek_seoJinTaek Seo
 
Functional Programming.pptx
Functional Programming.pptxFunctional Programming.pptx
Functional Programming.pptxKarthickT28
 
C operators
C operatorsC operators
C operatorsGPERI
 
Although people may be very accustomed to reading and understanding .docx
Although people may be very accustomed to reading and understanding .docxAlthough people may be very accustomed to reading and understanding .docx
Although people may be very accustomed to reading and understanding .docxmilissaccm
 
Topic 2_revised.pptx
Topic 2_revised.pptxTopic 2_revised.pptx
Topic 2_revised.pptxJAYAPRIYAR7
 
Unit 2 application of stack
Unit 2  application of stack Unit 2  application of stack
Unit 2 application of stack LavanyaJ28
 
Programming fundamentals 2:pointers in c++ clearly explained
Programming fundamentals 2:pointers in c++ clearly explainedProgramming fundamentals 2:pointers in c++ clearly explained
Programming fundamentals 2:pointers in c++ clearly explainedhozaifafadl
 
Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03Avelin Huo
 
07 control+structures
07 control+structures07 control+structures
07 control+structuresbaran19901990
 

Similar to Polish (20)

Unit 3 Stacks and Queues.pptx
Unit 3 Stacks and Queues.pptxUnit 3 Stacks and Queues.pptx
Unit 3 Stacks and Queues.pptx
 
Data Structures in C
Data Structures in CData Structures in C
Data Structures in C
 
Stack_Overview_Implementation_WithVode.pptx
Stack_Overview_Implementation_WithVode.pptxStack_Overview_Implementation_WithVode.pptx
Stack_Overview_Implementation_WithVode.pptx
 
DSA
DSADSA
DSA
 
sweetu stacks.pdf
sweetu stacks.pdfsweetu stacks.pdf
sweetu stacks.pdf
 
Unit II - LINEAR DATA STRUCTURES
Unit II -  LINEAR DATA STRUCTURESUnit II -  LINEAR DATA STRUCTURES
Unit II - LINEAR DATA STRUCTURES
 
01 stack 20160908_jintaek_seo
01 stack 20160908_jintaek_seo01 stack 20160908_jintaek_seo
01 stack 20160908_jintaek_seo
 
85ec7 session2 c++
85ec7 session2 c++85ec7 session2 c++
85ec7 session2 c++
 
Functional Programming.pptx
Functional Programming.pptxFunctional Programming.pptx
Functional Programming.pptx
 
C operators
C operatorsC operators
C operators
 
Chapter 6 ds
Chapter 6 dsChapter 6 ds
Chapter 6 ds
 
Although people may be very accustomed to reading and understanding .docx
Although people may be very accustomed to reading and understanding .docxAlthough people may be very accustomed to reading and understanding .docx
Although people may be very accustomed to reading and understanding .docx
 
Topic 2_revised.pptx
Topic 2_revised.pptxTopic 2_revised.pptx
Topic 2_revised.pptx
 
C++.pptx
C++.pptxC++.pptx
C++.pptx
 
Unit 2 application of stack
Unit 2  application of stack Unit 2  application of stack
Unit 2 application of stack
 
Java chapter 3
Java chapter 3Java chapter 3
Java chapter 3
 
Programming fundamentals 2:pointers in c++ clearly explained
Programming fundamentals 2:pointers in c++ clearly explainedProgramming fundamentals 2:pointers in c++ clearly explained
Programming fundamentals 2:pointers in c++ clearly explained
 
Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03
 
07 control+structures
07 control+structures07 control+structures
07 control+structures
 
Unit - 2 CAP.pptx
Unit - 2 CAP.pptxUnit - 2 CAP.pptx
Unit - 2 CAP.pptx
 

Recently uploaded

High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 

Recently uploaded (20)

Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 

Polish

  • 1. Dr. D. Y. Patil Pratishthan’s D.Y. Patil College Of Engineering & Technology, Kasaba Bawada, Kolhapur A Presentation On “Polish Notation” Presented By: 1.Daulmalik S. Mujawar. 2.Falaknaz N. Punekar. 3.Rohit Ugave. 4.Prajakta Suryavanshi.
  • 2. Index 1. Abstract 2. Introduction 3. Problem Statement 4. Approaches to tackle 5. Algorithm and Flow chart 6. Important construct of PL used 7. Result : All Possible input and output 8. Conclusion 9. Application 10.References
  • 3. Abstract • To evaluate and simplifies the arithmetic expression given by an user. The priorities are fixed in the project (^ then * / then + -). The input string is given by user with minimum 2 operands with 1 operator. • Operator Precedence :- Exponential Operator ^ Highest Precedence Multiplication/ Division */ Next Precedence Addition / Subtraction +- Least Precedence
  • 4. Introduction • Polish notation, also known as Polish prefix notation or simply prefix notation, is a form of notation for logic, arithmetic, and algebra. • Its distinguishing feature is that it places operators to the left of their operands. • If the arty of the operators is fixed, the result is a syntax lacking parentheses or other brackets that can still be parsed without ambiguity. • The Polish logician Jan Łukasiewicz invented this notation in 1924 in order to simplify sentential logic.
  • 5. Introduction(cont..) • Infix :- The infix notation is what we come across in our general mathematics, where the operator is written in-between the operands. – For E.g. :- A + B • Prefix :- The notation in which operator is place before the operands. It is also called as Polish notation. – E.g. :- + A B • Postfix :- The notation in which operator is place after the operands. It is also called as Reverse Polish notation or simply Suffix Notation. – E.g. :- A B +
  • 6. Problem Statement • Computer doesn’t understand the regular mathematical expression. So, complier needs to converts the regular expression into polish (prefix) notation expression for performing evaluation operation. • Read an expression in Polish notation, To simplify the Polish notation expression as much as possible. Case 1: + 3 4 Case 2: - x x Case 3: * - 6 + x -6 - - 9 6 * 0 c 7 - x x * - 6 + x -6 - 3 * 0 c
  • 7. APPROACHES TO TACKLE : 2.1Using Array We use array, in which array acts as stack and push and pop operations are performed on array stack. Eg:- Stc[20]; For(i=0;i<20;i++) { Scanf(“%d”,&a[i]); } 2.2Using structure In instead we can use structure to create stack and with top of stack.Object of a structure is considered as stack, and members of structure defines top of stack, terminals and non-terminals. Struct stack1{ Int tos=-1; Char tr,ntr; } s[100];
  • 8. ALGORITHM 3.1 Logic: 1. Start. 2. Enter the mathematical expression in polish notation. 3. Check entered expression is Prefix. If NO, go to step 6 4. Evaluate the expression. 5. Display the result 6. End.
  • 10. IMPORTANCE CONSTRUCTOR OF USED : Work related to checking entered expression is prefix. function’s used: •isopnd (char) This function is use to check the current element field is operand or not. If it’s a operand then it will push on to the stack and pointer is move to ext position. •isoprtr (char) This function is use to check the current element field is operator or not. If it’s a operand then it will push on to the stack and top is move to next position. •evaluate (char, int, int) This function is use to evaluate the given expression if two consecutive operator are pushed to the stack and after that push two consecutive operands on to stack then it evaluate this expression. •strlen() This is a inbuilt function which is used to calculate the length of given expression.
  • 12. For the Expression * - 6 + x - 6- - 9 6 * 1 c
  • 13. Conclusion • For evaluating given arithmetic expression Calculator / Computer needs simplified expressions. With the help of polish notation, the complex notation gets simplifies. • This Program will be used to simplify the complex mathematical polish notation expressions. This makes compiler to read the simplified expression effectively.
  • 14. Application • For evaluating given arithmetic expression. • Calculator.
  • 15. References / Bibliography • Books – Data Structures with C (Schaum's Outline Series) -by Seymour Lipschutz – Let Us C (Computer Science) -by Yashavant P. Kanetkar • Websites – The ACM International Collegiate Programming Contest (ICPC) https://icpc.baylor.edu/ – Stack Overflow http://stackoverflow.com/ – Polish notation https://en.wikipedia.org/wiki/Polish_notation – Tutorials Point http://www.tutorialspoint.com/data_structures_algorithms/expressionparsing.htm