1 / 84

Chapter 9

Chapter 9. Binary Trees. Chap.9 Contents. 9.1 Definition of Binary Tree 9.2 Properties of Binary Trees 9.3 The Binary Tree Theorem 9.4 External Path Length 9.5 Traversals of a Binary Tree. 9.1 Definition of Binary Tree. binary tree t 可為 empty tree 或 包含 :

karinm
Télécharger la présentation

Chapter 9

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. Chapter 9 Binary Trees

  2. Chap.9 Contents 9.1 Definition of Binary Tree 9.2 Properties of Binary Trees 9.3 The Binary Tree Theorem 9.4 External Path Length 9.5 Traversals of a Binary Tree

  3. 9.1 Definition of Binary Tree binary tree t 可為 empty tree 或 包含: 一個rootelement, 與兩個不同的binary trees, 分別叫 t 的left sub-tree及 right sub-tree

  4. Binary trees (elements 大小無規定) 1 2 2 3 1 3

  5. Binary search tree(elements 左小右大) 2 1 3

  6. Tri-nary (3-nary) search tree 2 4 1 3 5 What about N-nary search tree(n-元搜尋樹)? It is called B tree.

  7. This is NOT a binary search tree 5 3 7 4 1 9 8 Because 4 is NOT less than 3

  8. 9.2 Properties of Binary Trees

  9. level (x), the level of x, is the same as the depth (x). Is height (t) the same as depth(x)? ANS: No. See next page, height(50) is 3. depth(62) is 2.

  10. 這暗示我們: Complete binary tree 可用array來實作. L A B C D E R S F G

More Related