Chapter 8. Tree
Chapter 8. Tree
Chapter 8. Trees
Contents
1. Introduction to Trees
Contents
1. Introduction to Trees
2. Applications of Trees
Contents
1. Introduction to Trees
2. Applications of Trees
3. Tree Traversal
Contents
1. Introduction to Trees
2. Applications of Trees
3. Tree Traversal
4. Spanning Trees
Contents
1. Introduction to Trees
2. Applications of Trees
3. Tree Traversal
4. Spanning Trees
5. Minimum Spanning Trees
Definition
Definition
Definition
Theorem
Definition
Definition
I g is root of tree
I j is parent of m
and l
I m or l is a child of j
I m, l are siblings
I g is ancestor of m
and m is
descendant of g
Definition
Definition
Definition
Definition
Definition
Theorem
Theorem
Theorem
Example
Solution
Definition
Definition
Definition
Definition
Theorem
Theorem
Corollary
Definition
Definition
Definition
Algorithm
Algorithm
Example
Definition
Example
Suppose there are seven coins, all with the same weight,
and a counterfeit coin that weighs less than the others.
How many weighings are necessary using a balance
scale to determine which of the eight coins is the
counterfeit one?
Solution
Example
Example
Theorem
Corollary
Theorem
Example
Example
Example
Example
Definition
Huffman coding
Huffman coding
Example
Solution
Solution
Definition
Definition
Definition
Preorder Algorithm
Inorder Algorithm
Postorder Algorithm
Example
Example
Definition
Definition
Definition
Definition
Example
Example
Definition
Example
Theorem
Depth-First Search
Example
Breadth-First Search
Example
Definition
Prim’s Algorithm
Prim’s Algorithm
Example
Solution
Kruskal’s Algorithm
Kruskal’s Algorithm
Example