Successfully reported this slideshow.
Upcoming SlideShare
×

of

Upcoming SlideShare
Next

2 Likes

Share

# A2 Computing Reverse Polish Notation Part 2

See all

See all

### A2 Computing Reverse Polish Notation Part 2

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

Mar. 5, 2015
• #### aniketranjan1

Dec. 14, 2013

Total views

2,413

On Slideshare

0

From embeds

0

Number of embeds

16

0

Shares

0