SlideShare a Scribd company logo
Minster School Computing Reverse Polish Notation Part 2 Mr P  Stevens  [email_address]
Objectives Review key concepts from earlier RPN theory Apply RPN theory to the Stack Data Structure Review past paper RPN questions Review some aspects of the recent test
Convert to RPN Review (TP1) Convert the following expressions to RPN A * B + C * D      5 + ((1 + 2) * 4) − 3  
Convert to RPN Review Convert the following expressions to RPN A * B + C * D      AB*CD*+ 5 + ((1 + 2) * 4) − 3   12+4*5+3-
The Stack (A Reminder TP2) The Stack is LIFO To remove an item from the Stack we use the _________  command To place an item on the stack we use the __________ command
STACK OPERATIONS (TP3) (Example) using stack data structures to do this calculation 3 * 4 + 5 * 6 = 42 RPN =  3 4 * 5 6 * + Stack Operation Input
STACK OPERATIONS (Example) using stack data structures to do this calculation 3 * 4 + 5 * 6 = 42 RPN =  3 4 * 5 6 * + 12, 30 Pop 6,5 Multiply Push 30 12 Pop 4,3 Multiply Push 12 12, 5 Push 5 5 12, 5, 6 Push 6 6 42 Pop 30, 12 Add Push 42 3, 4 Push 4 4 3 Push 3 3 Stack Operation Input
Exercise Complete exercise 2 from the worksheet 2 Show your working out neatly
Plenary Objectives Understand where Polish form notation is applied Understand the terms Infix, Prefix and Postfix Convert expressions into RPN to produce postfix RPN expressions Appreciate how this theory is applied to the stack register Appreciate the role of Binary Tree Structures with RPN Review past paper RPN questions All resources available on the VLE! Test Paper Review
Ad

More Related Content

What's hot (20)

Code Optimization
Code OptimizationCode Optimization
Code Optimization
Akhil Kaushik
 
Priority queues
Priority queuesPriority queues
Priority queues
Priyanka Rana
 
Recursion
RecursionRecursion
Recursion
Ssankett Negi
 
Optimization of basic blocks
Optimization of basic blocksOptimization of basic blocks
Optimization of basic blocks
ishwarya516
 
Network programming Using Python
Network programming Using PythonNetwork programming Using Python
Network programming Using Python
Karim Sonbol
 
Stack - Data Structure - Notes
Stack - Data Structure - NotesStack - Data Structure - Notes
Stack - Data Structure - Notes
Omprakash Chauhan
 
Loops in c
Loops in cLoops in c
Loops in c
baabtra.com - No. 1 supplier of quality freshers
 
Symbol table management and error handling in compiler design
Symbol table management and error handling in compiler designSymbol table management and error handling in compiler design
Symbol table management and error handling in compiler design
Swati Chauhan
 
Files in c++ ppt
Files in c++ pptFiles in c++ ppt
Files in c++ ppt
Kumar
 
Top down and botttom up Parsing
Top down     and botttom up ParsingTop down     and botttom up Parsing
Top down and botttom up Parsing
Gerwin Ocsena
 
Command line-arguments-in-java-tutorial
Command line-arguments-in-java-tutorialCommand line-arguments-in-java-tutorial
Command line-arguments-in-java-tutorial
Kuntal Bhowmick
 
stack
stackstack
stack
Raj Sarode
 
Pointers - DataStructures
Pointers - DataStructuresPointers - DataStructures
Pointers - DataStructures
Omair Imtiaz Ansari
 
Lists and scrollbars
Lists and scrollbarsLists and scrollbars
Lists and scrollbars
myrajendra
 
heap Sort Algorithm
heap  Sort Algorithmheap  Sort Algorithm
heap Sort Algorithm
Lemia Algmri
 
Basics of python
Basics of pythonBasics of python
Basics of python
Jatin Kochhar
 
Top down parsing
Top down parsingTop down parsing
Top down parsing
ASHOK KUMAR REDDY
 
Modular programming
Modular programmingModular programming
Modular programming
Mohanlal Sukhadia University (MLSU)
 
Stack of Data structure
Stack of Data structureStack of Data structure
Stack of Data structure
Sheikh Monirul Hasan
 
Stacks in DATA STRUCTURE
Stacks in DATA STRUCTUREStacks in DATA STRUCTURE
Stacks in DATA STRUCTURE
Mandeep Singh
 

Similar to A2 Computing Reverse Polish Notation Part 2 (20)

Data structure lecture7
Data structure lecture7Data structure lecture7
Data structure lecture7
Kumar
 
Data strutcure and annalysis topic stack
Data strutcure and annalysis topic stackData strutcure and annalysis topic stack
Data strutcure and annalysis topic stack
MihirMishra36
 
PPT Lecture 3.2.1 stack newxxxxxxxxxx.pptx
PPT Lecture 3.2.1 stack newxxxxxxxxxx.pptxPPT Lecture 3.2.1 stack newxxxxxxxxxx.pptx
PPT Lecture 3.2.1 stack newxxxxxxxxxx.pptx
AdarshPrajapati26
 
cs201-list-stack-queue-linked-lists .ppt
cs201-list-stack-queue-linked-lists .pptcs201-list-stack-queue-linked-lists .ppt
cs201-list-stack-queue-linked-lists .ppt
4kdishinfo
 
cs201-list-stack-queue-linked-list (2).ppt
cs201-list-stack-queue-linked-list (2).pptcs201-list-stack-queue-linked-list (2).ppt
cs201-list-stack-queue-linked-list (2).ppt
4kdishinfo
 
Chapter 1 Basic Programming (Python Programming Lecture)
Chapter 1 Basic Programming (Python Programming Lecture)Chapter 1 Basic Programming (Python Programming Lecture)
Chapter 1 Basic Programming (Python Programming Lecture)
IoT Code Lab
 
Lecture 6 data structures and algorithms
Lecture 6 data structures and algorithmsLecture 6 data structures and algorithms
Lecture 6 data structures and algorithms
Aakash deep Singhal
 
stack.pptx
stack.pptxstack.pptx
stack.pptx
KalimuthuVelappan
 
Data Structure and Algorithms by Sabeen Memon03.pptx
Data Structure and Algorithms by Sabeen Memon03.pptxData Structure and Algorithms by Sabeen Memon03.pptx
Data Structure and Algorithms by Sabeen Memon03.pptx
msoomar8611
 
Annotaed slides for dynamic programming algorithm
Annotaed slides for dynamic programming algorithmAnnotaed slides for dynamic programming algorithm
Annotaed slides for dynamic programming algorithm
johnathangamal27
 
Csc1100 lecture14 ch16_pt2
Csc1100 lecture14 ch16_pt2Csc1100 lecture14 ch16_pt2
Csc1100 lecture14 ch16_pt2
IIUM
 
Chapter 6 ds
Chapter 6 dsChapter 6 ds
Chapter 6 ds
Hanif Durad
 
Lisp programming
Lisp programmingLisp programming
Lisp programming
ilias ahmed
 
6-Python-Recursion PPT.pptx
6-Python-Recursion PPT.pptx6-Python-Recursion PPT.pptx
6-Python-Recursion PPT.pptx
Venkateswara Babu Ravipati
 
Topic 2_revised.pptx
Topic 2_revised.pptxTopic 2_revised.pptx
Topic 2_revised.pptx
JAYAPRIYAR7
 
Cis068 08
Cis068 08Cis068 08
Cis068 08
FALLEE31188
 
Stacks.ppt
Stacks.pptStacks.ppt
Stacks.ppt
OliverKane3
 
Stacks.ppt
Stacks.pptStacks.ppt
Stacks.ppt
OliverKane3
 
STACK Applications in DS
STACK Applications in DSSTACK Applications in DS
STACK Applications in DS
NARESH GUMMAGUTTA
 
Compilation
CompilationCompilation
Compilation
magansandu
 
Data structure lecture7
Data structure lecture7Data structure lecture7
Data structure lecture7
Kumar
 
Data strutcure and annalysis topic stack
Data strutcure and annalysis topic stackData strutcure and annalysis topic stack
Data strutcure and annalysis topic stack
MihirMishra36
 
PPT Lecture 3.2.1 stack newxxxxxxxxxx.pptx
PPT Lecture 3.2.1 stack newxxxxxxxxxx.pptxPPT Lecture 3.2.1 stack newxxxxxxxxxx.pptx
PPT Lecture 3.2.1 stack newxxxxxxxxxx.pptx
AdarshPrajapati26
 
cs201-list-stack-queue-linked-lists .ppt
cs201-list-stack-queue-linked-lists .pptcs201-list-stack-queue-linked-lists .ppt
cs201-list-stack-queue-linked-lists .ppt
4kdishinfo
 
cs201-list-stack-queue-linked-list (2).ppt
cs201-list-stack-queue-linked-list (2).pptcs201-list-stack-queue-linked-list (2).ppt
cs201-list-stack-queue-linked-list (2).ppt
4kdishinfo
 
Chapter 1 Basic Programming (Python Programming Lecture)
Chapter 1 Basic Programming (Python Programming Lecture)Chapter 1 Basic Programming (Python Programming Lecture)
Chapter 1 Basic Programming (Python Programming Lecture)
IoT Code Lab
 
Lecture 6 data structures and algorithms
Lecture 6 data structures and algorithmsLecture 6 data structures and algorithms
Lecture 6 data structures and algorithms
Aakash deep Singhal
 
Data Structure and Algorithms by Sabeen Memon03.pptx
Data Structure and Algorithms by Sabeen Memon03.pptxData Structure and Algorithms by Sabeen Memon03.pptx
Data Structure and Algorithms by Sabeen Memon03.pptx
msoomar8611
 
Annotaed slides for dynamic programming algorithm
Annotaed slides for dynamic programming algorithmAnnotaed slides for dynamic programming algorithm
Annotaed slides for dynamic programming algorithm
johnathangamal27
 
Csc1100 lecture14 ch16_pt2
Csc1100 lecture14 ch16_pt2Csc1100 lecture14 ch16_pt2
Csc1100 lecture14 ch16_pt2
IIUM
 
Lisp programming
Lisp programmingLisp programming
Lisp programming
ilias ahmed
 
Topic 2_revised.pptx
Topic 2_revised.pptxTopic 2_revised.pptx
Topic 2_revised.pptx
JAYAPRIYAR7
 
Ad

Recently uploaded (20)

Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdfExploring-Substances-Acidic-Basic-and-Neutral.pdf
Exploring-Substances-Acidic-Basic-and-Neutral.pdf
Sandeep Swamy
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Ad

A2 Computing Reverse Polish Notation Part 2

  • 1. Minster School Computing Reverse Polish Notation Part 2 Mr P Stevens [email_address]
  • 2. Objectives Review key concepts from earlier RPN theory Apply RPN theory to the Stack Data Structure Review past paper RPN questions Review some aspects of the recent test
  • 3. Convert to RPN Review (TP1) Convert the following expressions to RPN A * B + C * D  5 + ((1 + 2) * 4) − 3 
  • 4. Convert to RPN Review Convert the following expressions to RPN A * B + C * D  AB*CD*+ 5 + ((1 + 2) * 4) − 3  12+4*5+3-
  • 5. The Stack (A Reminder TP2) The Stack is LIFO To remove an item from the Stack we use the _________ command To place an item on the stack we use the __________ command
  • 6. STACK OPERATIONS (TP3) (Example) using stack data structures to do this calculation 3 * 4 + 5 * 6 = 42 RPN = 3 4 * 5 6 * + Stack Operation Input
  • 7. STACK OPERATIONS (Example) using stack data structures to do this calculation 3 * 4 + 5 * 6 = 42 RPN = 3 4 * 5 6 * + 12, 30 Pop 6,5 Multiply Push 30 12 Pop 4,3 Multiply Push 12 12, 5 Push 5 5 12, 5, 6 Push 6 6 42 Pop 30, 12 Add Push 42 3, 4 Push 4 4 3 Push 3 3 Stack Operation Input
  • 8. Exercise Complete exercise 2 from the worksheet 2 Show your working out neatly
  • 9. Plenary Objectives Understand where Polish form notation is applied Understand the terms Infix, Prefix and Postfix Convert expressions into RPN to produce postfix RPN expressions Appreciate how this theory is applied to the stack register Appreciate the role of Binary Tree Structures with RPN Review past paper RPN questions All resources available on the VLE! Test Paper Review