Download presentation
Presentation is loading. Please wait.
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
4
9.1 Definition of Binary Tree
binary tree t 可為 empty tree 或 包含: 一個 root element, 與兩個不同的 binary trees, 分別叫 t 的 left sub-tree 及 right sub-tree
11
Binary trees (elements 大小無規定)
12
Binary search tree (elements 左小右大)
2
13
Tri-nary (3-nary) search tree
2 4 What about N-nary search tree(n-元搜尋樹)? It is called B tree.
15
This is NOT a binary search tree
5 Because 4 is NOT less than 3
18
9.2 Properties of Binary Trees
35
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.
48
這暗示我們: Complete binary tree 可用 array來實作. A B C D E R S F G L
55
9.3 The Binary Tree Theorem
65
9.4 External Path Length
69
9.5 Traversals of a Binary Tree
84
ANS: inOrder FDGBLEARCS postOrder FGDLEBRSCA preOrder ABDFGELCRS breathFirst ABCDERSFGL
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.