1 / 11

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

橫越(追蹤)演算法_前序. 名詞介紹 二元樹. 1. 二元樹就是一個 有根樹 ( 有根樹:樹根入度數為 0 ,其它頂點入度數為 1 ) 2. 每個頂點 最多 只有 2 個子頂點 3. 每個子頂點會特別標明 左子頂點 或 右子頂點 4. 由 左子頂點 和 它的後代頂點 連接起來的頂點稱: 左子樹 5. 由 右子頂點 和 它的後代頂點 連接起來的頂點稱: 右子樹 6. 在某一個頂點上 處理資料 稱: 拜訪 7. 對圖上 每個頂點正好只拜訪一次 的搜尋過程稱: 追蹤 8. 拜訪順序列舉所有頂點稱: 列舉 9. 將算術運算式以二元樹表示稱: 表示樹. 左子頂點.

Download Presentation

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

An Image/Link below is provided (as is) to download presentation 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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. 名詞介紹二元樹 1.二元樹就是一個有根樹(有根樹:樹根入度數為 0 ,其它頂點入度數為 1 ) 2.每個頂點最多只有 2 個子頂點 3.每個子頂點會特別標明左子頂點或右子頂點 4.由左子頂點和它的後代頂點連接起來的頂點稱:左子樹 5.由右子頂點和它的後代頂點連接起來的頂點稱:右子樹 6.在某一個頂點上處理資料稱:拜訪 7.對圖上每個頂點正好只拜訪一次的搜尋過程稱:追蹤 8.拜訪順序列舉所有頂點稱:列舉 9.將算術運算式以二元樹表示稱:表示樹 左子頂點 右子頂點 R 左子樹 右子樹 A B

  3. 5.48(a) 5.48(b) 5.48(c) V的左子樹 V的右子頂點:U W的左子頂點 和右子樹 5.48(d) 5.48(e) 5.48(f)

  4. (P.300) ※將算術運算式以二元樹表示稱:表示樹

  5. (P.301) + * a (b*c) b c

  6. (P.301) 把 a + d * ( b – c ) 看成 a + (d * ( b – c )) + * a d*(b-c) - (b-c) d b c

  7. (P.301) - + - (a+b*c) (f-d/e) / * a f (d/e) (b*c) b c d e

  8. (P.302) 前序追踨 呼叫自己(遞迴) (1) A (2) B (6) C (3) D (5) E A B D F E G C 前序列舉: (4) (6) G F

  9. 1 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 前序列舉:

  10. -+a*bc-f/de *ab +a*d-bc +a*bc

  11. + - 2 * 3 4 + 4 / 8 2 12 + - 2 + 4 / 8 2 + -10 + 4 / 8 2 + 4 -10 + 4 + 8 -2 -10

More Related