Your SlideShare is downloading. ×
0
Reverse polish notation
Reverse polish notation
Reverse polish notation
Reverse polish notation
Reverse polish notation
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Reverse polish notation

667

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
667
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. BEDMASBIDMASBODMASPEMDAS
  • 2. 6,2/1,2+* * / +6 2 1 2 / 6,2,1,2,+*/ * +6 2 1 2
  • 3. Evaluating RPN• Uses a stack and two simple rules. Reading left to right …….• 1. If a value appears next in the expression, push this value on to the stack.• 2. If an operator appears next, pop two items from the top of the stack and push the result of the operation on to the stack.
  • 4. Reverse Polish Notation Examples 7,4+3- 7+4-3 1,2*3+ 1*2+3 1,2+3* (1+2) *3 5,9,2*+ 5+9*2 1,2*3,4*+ 1*2+3*4
  • 5. Converting from infix to postfix ‘Shunting yard algorithm’• Read each character • Calculator - another• If its an operand, add it to the output• If it’s an operator then – If there’s a higher BODMAS priority operator at the top of the stack, pop it – Push it on the stack• At the end, pop everything off the operator stack

×