树和二叉树下部梁.pptVIP

  • 2
  • 0
  • 约1.52万字
  • 约 100页
  • 2019-10-23 发布于广东
  • 举报
第7章 树和二叉树 主讲:梁宝兰 第7章 树和二叉树 教学要求: 1、理解和掌握:树的定义、术语;树的各种表示方式和存储结构;二叉树的定义、性质及其存储方法;二叉树的二叉链表存储方式、结点结构和类型定义;二叉树的三种遍历算法,能够灵活运用二叉树的遍历方法解决相关的应用问题;哈夫曼树的概念及哈夫曼编码。 2、了解:二叉树的分步遍历;二叉树的线索化方法;树与二叉树的转换;树的遍历。 内容提要 //二叉树的结点类的定义 class Node { friend class BTree; private: ElemType data; //数据元素值 Node *lChild; //左子树指针 Node *rChild; //右子树指针 public: Node() { lChild = NULL; rChild = NULL; } Node( ElemType item, Node *left = NULL,Node *right = NULL ){ data = item; lChild = left; rChild = right; } ~Node(){} }; class BTree { private: Node* root; public: BTree()

文档评论(0)

1亿VIP精品文档

相关文档