1 / 11

# 橫越(追蹤)演算法_前序 - PowerPoint PPT Presentation

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about ' 橫越(追蹤)演算法_前序' - aurelia-byers

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### 橫越(追蹤)演算法_前序

1.二元樹就是一個有根樹(有根樹：樹根入度數為 0 ，其它頂點入度數為 1 )

2.每個頂點最多只有 2 個子頂點

3.每個子頂點會特別標明左子頂點或右子頂點

4.由左子頂點和它的後代頂點連接起來的頂點稱：左子樹

5.由右子頂點和它的後代頂點連接起來的頂點稱：右子樹

6.在某一個頂點上處理資料稱：拜訪

7.對圖上每個頂點正好只拜訪一次的搜尋過程稱：追蹤

8.拜訪順序列舉所有頂點稱：列舉

9.將算術運算式以二元樹表示稱：表示樹

R

A

B

5.48(b)

5.48(c)

V的左子樹

V的右子頂點：U

W的左子頂點

5.48(d)

5.48(e)

5.48(f)

※將算術運算式以二元樹表示稱：表示樹

*

a

(b*c)

b

c

*

a

d*(b-c)

-

(b-c)

d

b

c

-

+

-

(a+b*c)

(f-d/e)

/

*

a

f

(d/e)

(b*c)

b

c

d

e

(1)

A

(2)

B

(6)

C

(3)

D

(5)

E

A

B

D

F

E

G

C

(4)

(6)

G

F

2

10

3

9

12

11

13

4

16

5

8

14

15

6

7

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

*ab

+a*d-bc

+a*bc

-

2

*

3

4

+

4

/

8

2

12

+

-

2

+

4

/

8

2

+

-10

+

4

/

8

2

+

4

-10

+

4

+

8

-2

-10