- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
数据结构Chap6
Chapter06 Tree and binary tree第六章 树和二叉树 Prof. Qing Wang 本章学习的线索 主要线索 重点 树和二叉树的定义及表示 二叉树的遍历 树、森林和二叉树的转换 哈夫曼树和哈夫曼编码 难点 二叉树的遍历及线索化 Contents Definition and notations of Tree and Forest Notations and representation of binary tree Binary tree traversal Threading binary tree Reconstruction of binary tree Transformation among Tree, Forest and binary tree Huffman tree and Huffman coding 6.1 Definition and notations of Tree Examples Discussion Storage structure of tree General list Discussion Storage structure of tree Fixed multiple-branch list Number of branch:tree’s degree Null Pointer? Variable multiple-branch list Number of branch:node’s degree 6.2 Binary tree Examples of binary tree 6.3 storage of binary tree Example Static tri-branch linked list 6.4 Traversal of binary tree 6.4.2 Traversal algorithms Recursive algorithm (递归算法) InOrderTraverse (中序遍历) PreOrderTraverse (先序遍历) PostOrderTraverse (后序遍历) Non-recursive algorithm (非递归算法) InOrderTraverse (中序遍历) PreOrderTraverse (先序遍历) PostOrderTraverse (后序遍历) LevelOrderTraverse (按层次遍历) Inorder traversal Framework of Inorder traversal If binary tree T is NULL, NULL operation else 1) Inorder traverse the left sub-tree 2) Visit root 3) Inorder traverse the right sub-tree Result of Inorder traversal Preorder traversal Framework of Preorder traversal If binary tree T is NULL, NULL operation else Visit root Preorder traverse the left sub-tree Preorder traverse the right sub-tree Result of Inorder traversal Postorder traversal Framework of Postorder traversal If binary tree T is NULL, NULL operation else Postorder traverse the left sub-tree Postorder traverse the right sub-tree Visit root Result of Inorder traversal Other recursive algorithm of binary tree 1. Get the number of nodes of binary tree (求二叉树的结点个数) Other recursive algorithm of binary tree 2. Get the depth of binary tree (求二叉树的深度) Initialization of binary tree via PreOrder LevelOrderTraversal From the root, visit the node from the top to the bottom, and from the
您可能关注的文档
最近下载
- 不同的拧紧策略的优缺点分析课件.pptx VIP
- 第三单元有趣的纸藤编织(课件)-五年级上册综合实践活动全国通用.pptx VIP
- 临床药物治疗学(本科).docx VIP
- 在办公用房权属统一登记工作动员会上的讲话.docx VIP
- ANSI ESD STM11.12-2021平面材料的体积电阻测量.pdf VIP
- 同济大学顾祥林-混凝土结构课后答案.pdf VIP
- 05人工智能技术的突破-大语言模型技术02.pptx VIP
- 安全文明施工方案.docx VIP
- 05人工智能技术的突破-大语言模型技术01.pptx VIP
- 矿井供电系统与井下供电安全培训课件PPT(共 51张).ppt VIP
文档评论(0)