《数据结构的算法在C++中的应用》(英文版)Chapter 8 Binary and other trees

Chapter 8 Binary and other trees
Chapter 8 Binary and other trees

Two kinds of data structure Linear: list, stack, queue, string Non-linear: tree, graph
Two kinds of data structure • Linear: list, stack, queue, string • Non-linear: tree, graph

8. 1 Tree 1. Definition: A tree t is a finite nonempty set of elements One of these elements is called the root, and the remaining elements(if any are partitioned into trees which are called the subtrees of t
8.1 Tree 1.Definition: A tree T is a finite nonempty set of elements. One of these elements is called the root, and the remaining elements(if any) are partitioned into trees which are called the subtrees of T

8. 1 Tree example B C ①D E)①G①① KL
8.1 Tree • example A B C D E F G H I J K L M

8. 1 Tree Terminology Degree of an elememts: the number of children it has Degree of a tree: the maximum of its element d legree Leaf: element whose degree is o Branch: element whose degree is not o
8.1 Tree 2.Terminology • Degree of an elememts: the number of children it has. • Degree of a tree: the maximum of its element degrees • Leaf: element whose degree is 0 • Branch: element whose degree is not 0

8. 1 Tree Level the level of root is 1 the level of an elementthe level of its parent+1 Depth of a tree the maximum level of its elements
8.1 Tree • Level: the level of root is 1 the level of an element=the level of its parent+1 • Depth of a tree: the maximum level of its elements

8.2 Binary Trees I Definition a binary tree t is a finite (possibly empty) collection of elements When the binary tree is not empty It has a root element The remaining elements(if any)are partitioned into two binary trees, which are called the left and right subtrees oft
8.2 Binary Trees 1.Definition: A binary tree t is a finite (possibly empty) collection of elements. When the binary tree is not empty: • It has a root element • The remaining elements(if any) are partitioned into two binary trees, which are called the left and right subtrees of t

8.2 Binary Trees 2.The essential differences between a binary tree and a tree are da binary tree can be empty, whereas a tree cannot 2 )Each element in a binary tree has exactly two subtrees(one or both of these subtrees may be empty). Each element in a tree can have any number of subtrees
8.2 Binary Trees 2.The essential differences between a binary tree and a tree are: 1)A binary tree can be empty,whereas a tree cannot. 2)Each element in a binary tree has exactly two subtrees(one or both of these subtrees may be empty).Each element in a tree can have any number of subtrees

8.2 Binary Trees 3)The subtrees of each element in a binary tree are ordered. That is, we distinguish between the left and the right subtrees.The subtrees in a tree are unordered
8.2 Binary Trees 3) The subtrees of each element in a binary tree are ordered. That is, we distinguish between the left and the right subtrees.The subtrees in a tree are unordered

8.2 Binary Trees Example of a binary tree b d
8.2 Binary Trees • Example of a binary tree + * / a b c d
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《数据结构的算法在C++中的应用》(英文版)Chapter 7 Hashing.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 6 Queue.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 5 Stack.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 4 Arrays and Matrix.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 3 Linear List.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 2 Program performance.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 1 preface.ppt
- 《数据结构的算法在C++中的应用》(英文版)Textbook.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第9章 宏.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第8章 数据访问页.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第7章 建立Access报表.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第6章 Access窗体的操作.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第5章 查询的创建及应用.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第4章 建构Access数据库表.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第3章 创建Access数据库.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第2章 Access 2002应用基础.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第1章 数据库原理及基本概念.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第12章 综合实例应用.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第11章 Access数据库的管理.ppt
- 《Access数据库应用教程》教学资源(PPT课件讲稿)第10章 Access模块和应用程序设计.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 9 Priority Queues.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 11 Search Trees.ppt
- 《数据结构的算法在C++中的应用》(英文版)Chapter 12 Graphs.ppt
- 四川电力职业技术学院:《ASP网络程序设计》目录.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第五章 数据库基础知识.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第二章 ASP初步.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第一章 网络程序设计概述.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第三章 ASP脚本语 VBScript.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第四章 ASP常用内部对象.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第六章 ASP数据库编程.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第八章 使用第三方组件.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第七章 文件存取组件及其它组.ppt
- 四川电力职业技术学院:《ASP网络程序设计》第一章 网络程序设计概述.ppt
- 《ASP动态网页设计》电子教案.doc
- 《ASP动态网页设计》教学大纲.doc
- 《ASP动态网页设计》教学进度表.doc
- 《ASP动态网页设计》进度计划.doc
- 《ASP动态网页设计》课程设计指导书.doc
- 《ASP动态网页设计》课程综合习题集.doc
- 《ASP动态网页设计》实验指导书.doc