28
1 Postfix Demo Input push 1 6 2 1 3 4 * 5 + * * +

Postfix Demo

  • Upload
    bian

  • View
    36

  • Download
    1

Embed Size (px)

DESCRIPTION

Input. Postfix Demo. 1. 2. 3. 4. 5. *. +. 6. *. *. +. push 1. Input. Top of stack. Postfix Demo. 1. 2. 3. 4. 5. *. +. 6. *. *. +. push 1. 1. Input. Top of stack. Postfix Demo. 1. 2. 3. 4. 5. *. +. 6. *. *. +. 1. Input. Top of stack. Postfix Demo. 1. - PowerPoint PPT Presentation

Citation preview

Page 1: Postfix Demo

1

Postfix Demo

Input

push 1

621 3 4 *5 + ** +

Page 2: Postfix Demo

2

Postfix Demo

1

Input

Top of stack

push 1

621 3 4 *5 + ** +

Page 3: Postfix Demo

3

Postfix Demo

1

Input

Top of stack

621 3 4 *5 + ** +

Page 4: Postfix Demo

4

Postfix Demo

1

Input

Top of stack

2

621 3 4 *5 + ** +

Page 5: Postfix Demo

5

Postfix Demo

1

Input

Top of stack

2

621 3 4 *5 + ** +

Page 6: Postfix Demo

6

Postfix Demo

1

Input

Top of stack

2 3

621 3 4 *5 + ** +

Page 7: Postfix Demo

7

Postfix Demo

1

Input

Top of stack

2 3

621 3 4 *5 + ** +

Page 8: Postfix Demo

8

Postfix Demo

1

Input

Top of stack

2 3 4

621 3 4 *5 + ** +

Page 9: Postfix Demo

9

Postfix Demo

1

Input

Top of stack

2 3 4

621 3 4 *5 + ** +

Page 10: Postfix Demo

10

Postfix Demo

1

Input

Top of stack

2 3 4 5

621 3 4 *5 + ** +

Page 11: Postfix Demo

11

Postfix Demo

1

Input

Top of stack

2 3 4 5

pop two elements off the stack and push their product

621 3 4 *5 + ** +

Page 12: Postfix Demo

12

Postfix Demo

1

Input

Top of stack

2 3

4 5 *

54

pop two elements off the stack and push their product

621 3 4 *5 + ** +

Page 13: Postfix Demo

13

Postfix Demo

1

Input

Top of stack

2 3 20

4 5 *

pop two elements off the stack and push their product

621 3 4 *5 + ** +

Page 14: Postfix Demo

14

Postfix Demo

1

Input

Top of stack

2 3 20

pop two elements off the stack and push their sum

621 3 4 *5 + ** +

Page 15: Postfix Demo

15

Postfix Demo

1

Input

Top of stack

2

3 20 +

203

pop two elements off the stack and push their sum

621 3 4 *5 + ** +

Page 16: Postfix Demo

16

Postfix Demo

1

Input

Top of stack

2

3 20 +

23

pop two elements off the stack and push their sum

621 3 4 *5 + ** +

Page 17: Postfix Demo

17

Postfix Demo

1

Input

Top of stack

2 23

621 3 4 *5 + ** +

Page 18: Postfix Demo

18

Postfix Demo

1

Input

Top of stack

2 23 6

621 3 4 *5 + ** +

Page 19: Postfix Demo

19

Postfix Demo

1

Input

Top of stack

2 23 6

621 3 4 *5 + ** +

Page 20: Postfix Demo

20

Postfix Demo

1

Input

Top of stack

2

23 6 *

23 6

621 3 4 *5 + ** +

Page 21: Postfix Demo

21

Postfix Demo

1

Input

Top of stack

2 138

23 6 *

621 3 4 *5 + ** +

Page 22: Postfix Demo

22

Postfix Demo

621 3 4 *5 + ** +

Input

1

Top of stack

2 138

Page 23: Postfix Demo

23

Postfix Demo

Input

Top of stack

1

2 138 *

2 138

621 3 4 *5 + ** +

Page 24: Postfix Demo

24

Postfix Demo

1

621 3 4 *5 + ** +

Input

Top of stack

2 138 *

276

Page 25: Postfix Demo

25

Postfix Demo

1

621 3 4 *5 + ** +

Input

Top of stack

276

Page 26: Postfix Demo

26

Postfix Demo

1

621 3 4 *5 + ** +

Input

Top of stack

276

1 276 +

Page 27: Postfix Demo

27

Postfix Demo

277

621 3 4 *5 + ** +

Input

Top of stack

1 276 +

Page 28: Postfix Demo

28

Postfix Demo

277

621 3 4 *5 + ** +

Input

Top of stack