- 1、本文档共110页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
C语言课件-树 Fundamentals of Data Structures in C
Chapter 5 Trees Outline (1) Introduction (5.1) Binary Trees (5.2) Binary Tree Traversals (5.3) Additional Binary Tree Operations (5.4) Threaded Binary Trees (5.5) Heaps (5.6) (Chapter 9) Binary Search Trees (5.7) Outline (2) Selection Trees (5.8) Forests (5.9) Set Representation (5.10) Counting Binary Trees (5.11) References Exercises 5.1 Introduction What is a “Tree”? For Example : Figure 5.1 (a) An ancestor binary tree Figure 5.1 (b) The ancestry of modern Europe languages The Definition of Tree (1) A tree is a finite set of one or more nodes such that : (1) There is a specially designated node called the root. (2) The remaining nodes are partitioned into n ≥ 0 disjoint sets T1, …, Tn, where each of these sets is a tree.We call T1, …, Tn, the sub-trees of the root. The Definition of Tree (2) The root of this tree is node A. (Fig. 5.2) Definitions: Parent (A) Children (E, F) Siblings (C, D) Root (A) Leaf / Leaves K, L, F, G, M, I, J… The Definition of Tree (3) The degree of a node is the number of sub-trees of the node. The level of a node: Initially letting the root be at level one For all other nodes, the level is the level of the node’s parent plus one. The height or depth of a tree is the maximum level of any node in the tree. Representation of Trees (1) List Representation The root comes first, followed by a list of sub-trees Example: (A(B(E(K,L),F),C(G),D(H(M),I, J))) Representation of Trees (2) Left Child-Right Sibling Representation Fig.5.5 A Degree Two Tree Rotate clockwise by 45° A Binary Tree 5.2 Binary Trees A binary tree is a finite set of nodes that is either empty or consists of a root and two disjoint binary trees called the left sub-tree and the right sub-tree. Abstract Data Type Binary_Tree (structure 5.1) Structure Binary_Tree (abbreviated BinTree) is: Objects: a finite set of nodes either empty or consisting of a root node, left Binary_Tree, and right Binary_Tree. Functions: For all bt, bt1, bt2 ? BinTree, item ? element Bintree Create()
您可能关注的文档
- CNGI-CERNET2主干网IVI试商用配置文档.doc
- Combinatorial solid-state chemistry of inorganic materials-材料合成化学课件PPT.ppt
- Comparison of Administrative Ethics between China and America(2005年公共管理国际会议论文).doc
- Comparative Whistleblowing Administrative, Cultural, and Ethical Issues(2005年公共管理国际会议论文).doc
- Conductivities in stabilized Zirconia氧化钇稳定的氧化锆(YSZ)-课件PPT.ppt
- Construction of Communication Network Pattern and Information Security in E-Government(2005年公共管理国际会议论文).doc
- Creation of Regional Brand and Role of the Local Government ——Regional Branding Case Analysis of Wenzhou Shoe Industry Cluster(2006年公共管理国际会议论文).doc
- Criterion I—Comprehensive Community –Based Mental Health Services.doc
- Cultivation and Management of Public Human Resources in the Perspective of Scientific Outlook on Development(2006年公共管理国际会议论文).doc
- CS 结构体与共用体.ppt
- Dans la langue fon, parlée au Bénin, vodun signifie une puissance.doc
- De lanarchisme au combat identitaire linternet comme média.doc
- DDB广告创意赏析-广告提案、企划案、推广方案.ppt
- Developing Local Government Training Centers for Public Administrators in Serbia & Montenegro(2006年公共管理国际会议论文).doc
- Device Fabrication of Polymer solar cell-课件PPT.ppt
- Die Geburt von Helden – Charaktercreator für Warhammer Fantasy.doc
- Digital Jiuzhaigou Project A Successful Exploration into Administration of Environment & Natural Resources Protection and Development(2006年公共管理国际会议论文).doc
- Discussion on the Small-medium Sized Joint-stock Banks to Develop Internet Banking Business(2006年公共管理国际会议论文).doc
- DNA的复制Replication of DNA 109页精品课件PPT.ppt
- Draft Budget 201011 Submission - 06 May 2010 - PART 1 – ANNUAL BUDGET.doc
文档评论(0)