zoukankan      html  css  js  c++  java
  • 完全二叉树、理想二叉树满二叉树

    完全二叉树(Complete Binary Tree):

    设二叉树的深度为h,除第 h 层外,其它各层 (1~h-1) 的结点数都达到最大个数,第h层所有的结点都连续集中在最左边,这就是完全二叉树。

    理想二叉树(Perfect Binary Tree):

    除最后一层无任何子节点外,每一层上的所有结点都有两个子结点的树称为理想二叉树。高度为h(从0开始算起)且包含2^(h+1)-1个节点的

    二叉树是理想二叉树。

    满二叉树(Full Binary Tree):

    在国内,满二叉树实际上指的是上面提到的理想二叉树。而国际上所定义的满二叉树,和国内的定义不同,美国NIST给出的定义为:

    A binary tree in which each node has exactly zero or two children. In other words, every node is either a leaf or has two children.

  • 相关阅读:
    Python正课132 —— Vue 进阶5
    Python正课131 —— Vue 进阶4
    Python正课130 —— Vue 进阶3
    logging模块
    作业20
    suprocess模块
    configparser模块
    hashlib模块
    shutil模块
    序列化模块
  • 原文地址:https://www.cnblogs.com/lxw0109/p/binary-tree.html
Copyright © 2011-2022 走看看