数据机构Chapm
Chapter06 Tree and binary tree 要 点 一、了解二叉树的定义、性质和存储结构 二、掌握二叉树的遍历和线索化 三、了解树的定义和存储结构 四、了解树、森林与二叉树转换 五、了解树和森林的遍历 六、了解哈夫曼树及其应用 本章学习的线索 主要线索 重点 树和二叉树的定义及表示 二叉树的遍历 树、森林和二叉树的转换 哈夫曼树和哈夫曼编码 难点 二叉树的遍历及线索化 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 node of binary tree (求二叉树的结点个数) Other recursive algorithm of binary tree 2、Get the depth of binary tree (求二叉树的深度) int NumTreeLeaf(PBinTree T ) {//计算以T为根的二叉树的叶子结点个数 if(!T) return 0;
您可能关注的文档
最近下载
- 工程施工机具安全管理制度.pptx
- 2020年《钢结构设计规范》GB50017..pdf VIP
- 2024-2025学年河南省南阳市唐河县九年级(上)期末英语试卷(含答案).pdf VIP
- 浙江省杭州2024-2025学年高一上学期1月期末考试政治试题(含答案).pdf VIP
- 膜分离工程超滤(UF)课件.pptx VIP
- 浙江省杭州学军中学2024-2025学年高一上学期期末考试历史试题(含答案).pdf VIP
- 河南省南阳市唐河县2022-2023学年九年级上学期期末英语试卷.pdf VIP
- 旋挖钻孔灌注桩施工方案.docx VIP
- 阿特拉斯•科普柯 冷冻式干燥机.pdf VIP
- 超滤膜技术介绍.pptx VIP
原创力文档

文档评论(0)