Upcoming SlideShare
×

Introduction to trees

395 views

Published on

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
395
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
9
0
Likes
0
Embeds 0
No embeds

No notes for slide

Introduction to trees

1. 1. Chapter 6 Introduction to Trees Objectives Upon completion you will be able to: • Understand and use basic tree terminology and concepts • Recognize and define the basic attributes of a binary tree • Process trees using depth-first and breadth-first traversals • Parse expressions using a binary tree • Design and implement Huffman trees • Understand the basic use and processing of general trees Data Structures: A Pseudocode Approach with C 1
2. 2. 6-1 Basic Tree Concepts We begin the Chapter with a discussion of the terminology used with trees. Once the terminology is understood, we discuss three user-oriented tree representations: general trees, indented parts lists, and parenthetical trees. • Terminology • User Representation Data Structures: A Pseudocode Approach with C 2
3. 3. Data Structures: A Pseudocode Approach with C 3
4. 4. Data Structures: A Pseudocode Approach with C 4
5. 5. Data Structures: A Pseudocode Approach with C 5
6. 6. Data Structures: A Pseudocode Approach with C 6
7. 7. Data Structures: A Pseudocode Approach with C 7
8. 8. Data Structures: A Pseudocode Approach with C 8
9. 9. 6-2 Binary Trees A binary tree can have no more than two descendents. In this section we discuss the properties of binary trees, four different binary tree traversals, and two applications, expression trees and Huffman Code. • Properties • Binary Tree Traversals • Expression Trees • Huffman Code Data Structures: A Pseudocode Approach with C 9
10. 10. Data Structures: A Pseudocode Approach with C 10
11. 11. Data Structures: A Pseudocode Approach with C 11
12. 12. Data Structures: A Pseudocode Approach with C 12
13. 13. Data Structures: A Pseudocode Approach with C 13
14. 14. Data Structures: A Pseudocode Approach with C 14
15. 15. Data Structures: A Pseudocode Approach with C 15
16. 16. Data Structures: A Pseudocode Approach with C 16
17. 17. Data Structures: A Pseudocode Approach with C 17
18. 18. Data Structures: A Pseudocode Approach with C 18
19. 19. Data Structures: A Pseudocode Approach with C 19
20. 20. Data Structures: A Pseudocode Approach with C 20
21. 21. Data Structures: A Pseudocode Approach with C 21
22. 22. Data Structures: A Pseudocode Approach with C 22
23. 23. Data Structures: A Pseudocode Approach with C 23
24. 24. Data Structures: A Pseudocode Approach with C 24
25. 25. Data Structures: A Pseudocode Approach with C 25
26. 26. Data Structures: A Pseudocode Approach with C 26
27. 27. Data Structures: A Pseudocode Approach with C 27
28. 28. Data Structures: A Pseudocode Approach with C 28
29. 29. Data Structures: A Pseudocode Approach with C 29
30. 30. Data Structures: A Pseudocode Approach with C 30
31. 31. Data Structures: A Pseudocode Approach with C 31
32. 32. Data Structures: A Pseudocode Approach with C 32
33. 33. Data Structures: A Pseudocode Approach with C 33
34. 34. Data Structures: A Pseudocode Approach with C 34
35. 35. 6-3 General Trees A general tree can have an unlimited number of descendents. We discuss three topics in this section: general tree insertions, deletions, and converting a general tree to a binary tree. • Insertions into General Trees • General Tree Deletions • Changing a General Tree to a Binary Tree Data Structures: A Pseudocode Approach with C 35
36. 36. Data Structures: A Pseudocode Approach with C 36
37. 37. Data Structures: A Pseudocode Approach with C 37
38. 38. Data Structures: A Pseudocode Approach with C 38
39. 39. Data Structures: A Pseudocode Approach with C 39
40. 40. Data Structures: A Pseudocode Approach with C 40
41. 41. Data Structures: A Pseudocode Approach with C 41
42. 42. Data Structures: A Pseudocode Approach with C 42
43. 43. Data Structures: A Pseudocode Approach with C 43
44. 44. Data Structures: A Pseudocode Approach with C 44